Skip to content

Commit

Permalink
stop ts complaining
Browse files Browse the repository at this point in the history
  • Loading branch information
joetannenbaum committed Jan 15, 2025
1 parent 18ae08d commit 3a56916
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/core/src/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ class History {
return
}

cb = cb ?? (() => {})

if (this.preserveUrl) {
return cb()
cb && cb()
return
}

this.current = page
Expand All @@ -51,7 +50,7 @@ class History {
// Ensure any previous history.replaceState completes before pushState is executed.
const doPush = () => {
this.doPushState({ page: data }, page.url)
cb()
cb && cb()
}

if (isChromeIOS) {
Expand Down Expand Up @@ -142,10 +141,9 @@ class History {
return
}

cb = cb ?? (() => {})

if (this.preserveUrl) {
return cb()
cb && cb()
return
}

this.current = page
Expand All @@ -156,7 +154,7 @@ class History {
// Ensure any previous history.pushState completes before replaceState is executed.
const doReplace = () => {
this.doReplaceState({ page: data }, page.url)
cb()
cb && cb()
}

if (isChromeIOS) {
Expand Down

0 comments on commit 3a56916

Please sign in to comment.