From 3a56916d2013552135dd9862ea901b19fc893b1a Mon Sep 17 00:00:00 2001 From: Joe Tannenbaum Date: Wed, 15 Jan 2025 15:58:07 -0500 Subject: [PATCH] stop ts complaining --- packages/core/src/history.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/core/src/history.ts b/packages/core/src/history.ts index ff560f5c1..6534e3bb9 100644 --- a/packages/core/src/history.ts +++ b/packages/core/src/history.ts @@ -37,10 +37,9 @@ class History { return } - cb = cb ?? (() => {}) - if (this.preserveUrl) { - return cb() + cb && cb() + return } this.current = page @@ -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) { @@ -142,10 +141,9 @@ class History { return } - cb = cb ?? (() => {}) - if (this.preserveUrl) { - return cb() + cb && cb() + return } this.current = page @@ -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) {