mirror of
https://github.com/paricafe/misskey.git
synced 2025-02-17 13:37:29 -06:00
frontend: add same router
This commit is contained in:
parent
ca415508bd
commit
7b622d797d
1 changed files with 4 additions and 0 deletions
|
@ -25,6 +25,10 @@ export function setupRouter(app: App, routerFactory: ((path: string) => IRouter)
|
|||
window.history.pushState({ key: ctx.key }, '', ctx.path);
|
||||
});
|
||||
|
||||
mainRouter.addListener('same', () => {
|
||||
window.scroll({ top: 0, behavior: 'smooth' });
|
||||
});
|
||||
|
||||
mainRouter.addListener('replace', ctx => {
|
||||
window.history.replaceState({ key: ctx.key }, '', ctx.path);
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue