mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
4467991a07
commit
0c9d201edd
4 changed files with 42 additions and 16 deletions
|
@ -1,4 +1,4 @@
|
|||
define(['loading', 'viewManager', 'skinManager', 'pluginManager', 'backdrop', 'browser', 'pageJs', 'appSettings'], function (loading, viewManager, skinManager, pluginManager, backdrop, browser, page, appSettings) {
|
||||
define(['loading', 'viewManager', 'skinManager', 'pluginManager', 'backdrop', 'browser', 'pageJs', 'appSettings', 'apphost'], function (loading, viewManager, skinManager, pluginManager, backdrop, browser, page, appSettings, appHost) {
|
||||
|
||||
var embyRouter = {
|
||||
showLocalLogin: function (apiClient, serverId, manualLogin) {
|
||||
|
@ -300,17 +300,27 @@ define(['loading', 'viewManager', 'skinManager', 'pluginManager', 'backdrop', 'b
|
|||
|
||||
console.log('embyRouter - processing path request ' + pathname);
|
||||
|
||||
if ((!apiClient || !apiClient.isLoggedIn()) && !route.anonymous) {
|
||||
var isCurrentRouteStartup = currentRouteInfo ? currentRouteInfo.route.startup : true;
|
||||
var shouldExitApp = ctx.isBack && route.isDefaultRoute && isCurrentRouteStartup;
|
||||
|
||||
if (!shouldExitApp && (!apiClient || !apiClient.isLoggedIn()) && !route.anonymous) {
|
||||
console.log('embyRouter - route does not allow anonymous access, redirecting to login');
|
||||
beginConnectionWizard();
|
||||
return;
|
||||
}
|
||||
|
||||
if (shouldExitApp) {
|
||||
if (appHost.supports('exit')) {
|
||||
appHost.exit();
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (apiClient && apiClient.isLoggedIn()) {
|
||||
|
||||
console.log('embyRouter - user is authenticated');
|
||||
|
||||
var isCurrentRouteStartup = currentRouteInfo ? currentRouteInfo.route.startup : true;
|
||||
if (ctx.isBack && (route.isDefaultRoute || route.startup) && !isCurrentRouteStartup) {
|
||||
handleBackToDefault();
|
||||
return;
|
||||
|
@ -480,6 +490,7 @@ define(['loading', 'viewManager', 'skinManager', 'pluginManager', 'backdrop', 'b
|
|||
|
||||
// can't use this with home right now due to the back menu
|
||||
if (currentRouteInfo.route.type != 'home') {
|
||||
loading.hide();
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue