mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Resolve show promise
This commit is contained in:
parent
a18cd96012
commit
a536f2acac
1 changed files with 14 additions and 8 deletions
|
@ -44,13 +44,7 @@ class AppRouter {
|
||||||
}, 0);
|
}, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener('viewshow', () => {
|
document.addEventListener('viewshow', () => this.onViewShow());
|
||||||
const resolve = this.resolveOnNextShow;
|
|
||||||
if (resolve) {
|
|
||||||
this.resolveOnNextShow = null;
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.baseRoute = window.location.href.split('?')[0].replace(this.getRequestFile(), '');
|
this.baseRoute = window.location.href.split('?')[0].replace(this.getRequestFile(), '');
|
||||||
// support hashbang
|
// support hashbang
|
||||||
|
@ -417,6 +411,14 @@ class AppRouter {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onViewShow() {
|
||||||
|
const resolve = this.resolveOnNextShow;
|
||||||
|
if (resolve) {
|
||||||
|
this.resolveOnNextShow = null;
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onForcedLogoutMessageTimeout() {
|
onForcedLogoutMessageTimeout() {
|
||||||
const msg = this.forcedLogoutMsg;
|
const msg = this.forcedLogoutMsg;
|
||||||
this.forcedLogoutMsg = null;
|
this.forcedLogoutMsg = null;
|
||||||
|
@ -638,7 +640,11 @@ class AppRouter {
|
||||||
|
|
||||||
const ignore = route.dummyRoute === true || this.previousRoute.dummyRoute === true;
|
const ignore = route.dummyRoute === true || this.previousRoute.dummyRoute === true;
|
||||||
this.previousRoute = route;
|
this.previousRoute = route;
|
||||||
if (ignore) return;
|
if (ignore) {
|
||||||
|
// Resolve 'show' promise
|
||||||
|
this.onViewShow();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.handleRoute(ctx, next, route);
|
this.handleRoute(ctx, next, route);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue