diff --git a/packages/core/src/history.ts b/packages/core/src/history.ts index 1f5c1b271..5db7605bf 100644 --- a/packages/core/src/history.ts +++ b/packages/core/src/history.ts @@ -31,10 +31,16 @@ class History { } public pushState(page: Page, cb: (() => void) | null = null): void { - if (isServer || this.preserveUrl) { + if (isServer) { return } + if (this.preserveUrl) { + cb && cb(); + + return; + } + this.current = page this.addToQueue(() => { @@ -98,10 +104,16 @@ class History { public replaceState(page: Page, cb: (() => void) | null = null): void { currentPage.merge(page) - if (isServer || this.preserveUrl) { + if (isServer) { return } + if (this.preserveUrl) { + cb && cb(); + + return; + } + this.current = page this.addToQueue(() => {