Skip to content

Commit 143b344

Browse files
committed
omit meta from history
1 parent 46866ef commit 143b344

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/core/src/history.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,17 @@ export class History {
2121
}
2222

2323
public static pushState(page: Page): void {
24-
window.history.pushState(page, '', page.url)
24+
window.history.pushState(this.pageData(page), '', page.url)
2525
}
2626

2727
public static replaceState(page: Page): void {
28-
window.history.replaceState(page, '', page.url)
28+
window.history.replaceState(this.pageData(page), '', page.url)
29+
}
30+
31+
protected static pageData(page: Page): Omit<Page, 'meta'> {
32+
const { meta, ...remaining } = page
33+
34+
return remaining
2935
}
3036

3137
public static setState(key: string, value: any) {

0 commit comments

Comments
 (0)