diff --git a/src/components/appRouter.js b/src/components/appRouter.js index b23e532b4..e40875089 100644 --- a/src/components/appRouter.js +++ b/src/components/appRouter.js @@ -25,6 +25,7 @@ class AppRouter { msgTimeout; popstateOccurred = false; resolveOnNextShow; + previousRoute = {}; /** * Pages of "no return" (when "Go back" should behave differently, probably quitting the application). */ @@ -633,8 +634,13 @@ class AppRouter { getHandler(route) { return (ctx, next) => { ctx.isBack = this.popstateOccurred; - this.handleRoute(ctx, next, route); this.popstateOccurred = false; + + const ignore = route.dummyRoute === true || this.previousRoute.dummyRoute === true; + this.previousRoute = route; + if (ignore) return; + + this.handleRoute(ctx, next, route); }; } diff --git a/src/components/dialogHelper/dialogHelper.js b/src/components/dialogHelper/dialogHelper.js index 1f979bbce..5617f2a17 100644 --- a/src/components/dialogHelper/dialogHelper.js +++ b/src/components/dialogHelper/dialogHelper.js @@ -142,7 +142,7 @@ import '../../assets/css/scrollstyles.scss'; animateDialogOpen(dlg); if (isHistoryEnabled(dlg)) { - appRouter.pushState({ dialogId: hash }, 'Dialog', `#${hash}`); + appRouter.show('/dialog', { dialogId: hash }); window.addEventListener('popstate', onHashChange); } else { diff --git a/src/scripts/routes.js b/src/scripts/routes.js index 41497be0f..c74795724 100644 --- a/src/scripts/routes.js +++ b/src/scripts/routes.js @@ -560,6 +560,11 @@ import { appRouter } from '../components/appRouter'; serverRequest: true }); + defineRoute({ + path: '/dialog', + dummyRoute: true + }); + defineRoute({ path: '', isDefaultRoute: true,