1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Update dialog history handling

This commit is contained in:
Bill Thornton 2022-04-27 15:14:35 -04:00
parent 2887639243
commit c49f53257c
3 changed files with 33 additions and 35 deletions

View file

@ -11,7 +11,7 @@ import ServerConnections from './ServerConnections';
import alert from './alert';
import reactControllerFactory from './reactControllerFactory';
const history = createHashHistory();
export const history = createHashHistory();
/**
* Page types of "no return" (when "Go back" should behave differently, probably quitting the application).
@ -20,14 +20,13 @@ const START_PAGE_TYPES = ['home', 'login', 'selectserver'];
class AppRouter {
allRoutes = new Map();
currentRouteInfo;
currentRouteInfo = { route: {} };
currentViewLoadRequest;
firstConnectionResult;
forcedLogoutMsg;
msgTimeout;
promiseShow;
resolveOnNextShow;
previousRoute = {};
constructor() {
document.addEventListener('viewshow', () => this.onViewShow());
@ -482,9 +481,9 @@ class AppRouter {
#getHandler(route) {
return (ctx, next) => {
const ignore = route.dummyRoute === true || this.previousRoute.dummyRoute === true;
this.previousRoute = route;
const ignore = ctx.path === this.currentRouteInfo.path;
if (ignore) {
console.debug('[appRouter] path did not change, ignoring route change');
// Resolve 'show' promise
this.onViewShow();
return;