mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update routing
This commit is contained in:
parent
154f6b5fd8
commit
2cf4c1c4e0
3 changed files with 8 additions and 28 deletions
|
@ -215,7 +215,6 @@
|
||||||
if (LibraryBrowser.needsRefresh(tabContent)) {
|
if (LibraryBrowser.needsRefresh(tabContent)) {
|
||||||
if (window.ApiClient) {
|
if (window.ApiClient) {
|
||||||
var userId = Dashboard.getCurrentUserId();
|
var userId = Dashboard.getCurrentUserId();
|
||||||
|
|
||||||
Dashboard.showLoadingMsg();
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
getDisplayPreferences('home', userId).then(function (result) {
|
getDisplayPreferences('home', userId).then(function (result) {
|
||||||
|
|
|
@ -402,6 +402,8 @@
|
||||||
|
|
||||||
onTabbedpagebeforeshowInternal: function (page, e, isFirstLoad) {
|
onTabbedpagebeforeshowInternal: function (page, e, isFirstLoad) {
|
||||||
|
|
||||||
|
var pages = page.querySelector('neon-animated-pages');
|
||||||
|
|
||||||
if (isFirstLoad) {
|
if (isFirstLoad) {
|
||||||
|
|
||||||
console.log('selected tab is null, checking query string');
|
console.log('selected tab is null, checking query string');
|
||||||
|
@ -420,13 +422,11 @@
|
||||||
tabs.selected = selected;
|
tabs.selected = selected;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
page.querySelector('neon-animated-pages').selected = selected;
|
pages.selected = selected;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
var pages = page.querySelector('neon-animated-pages');
|
|
||||||
|
|
||||||
// Go back to the first tab
|
// Go back to the first tab
|
||||||
if (LibraryBrowser.enableFullPaperTabs() && !e.detail.isRestored) {
|
if (LibraryBrowser.enableFullPaperTabs() && !e.detail.isRestored) {
|
||||||
if (pages.selected) {
|
if (pages.selected) {
|
||||||
|
|
|
@ -1518,8 +1518,8 @@ var AppInfo = {};
|
||||||
//});
|
//});
|
||||||
|
|
||||||
events.on(connectionManager, 'localusersignedin', function (e, user) {
|
events.on(connectionManager, 'localusersignedin', function (e, user) {
|
||||||
|
|
||||||
localApiClient = connectionManager.getApiClient(user.ServerId);
|
localApiClient = connectionManager.getApiClient(user.ServerId);
|
||||||
|
window.ApiClient = localApiClient;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2942,7 +2942,8 @@ var AppInfo = {};
|
||||||
window.Emby.TransparencyLevel = pageObjects.TransparencyLevel;
|
window.Emby.TransparencyLevel = pageObjects.TransparencyLevel;
|
||||||
defineCoreRoutes();
|
defineCoreRoutes();
|
||||||
Emby.Page.start({
|
Emby.Page.start({
|
||||||
click: true
|
click: true,
|
||||||
|
hashbang: true
|
||||||
});
|
});
|
||||||
|
|
||||||
var postInitDependencies = [];
|
var postInitDependencies = [];
|
||||||
|
@ -3227,7 +3228,7 @@ pageClassOn('viewshow', "page", function () {
|
||||||
|
|
||||||
var apiClient = window.ApiClient;
|
var apiClient = window.ApiClient;
|
||||||
|
|
||||||
if (apiClient && apiClient.accessToken() && Dashboard.getCurrentUserId()) {
|
if (apiClient && apiClient.isLoggedIn()) {
|
||||||
|
|
||||||
var isSettingsPage = page.classList.contains('type-interior');
|
var isSettingsPage = page.classList.contains('type-interior');
|
||||||
|
|
||||||
|
@ -3244,29 +3245,9 @@ pageClassOn('viewshow', "page", function () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
|
||||||
|
|
||||||
var isConnectMode = Dashboard.isConnectMode();
|
|
||||||
|
|
||||||
if (isConnectMode) {
|
|
||||||
|
|
||||||
if (!Dashboard.isServerlessPage()) {
|
|
||||||
Dashboard.logout();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isConnectMode && this.id !== "loginPage" && !page.classList.contains('forgotPasswordPage') && !page.classList.contains('forgotPasswordPinPage') && !page.classList.contains('wizardPage') && this.id !== 'publicSharedItemPage') {
|
|
||||||
|
|
||||||
console.log('Not logged into server. Redirecting to login.');
|
|
||||||
Dashboard.logout();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Dashboard.ensureHeader(page);
|
Dashboard.ensureHeader(page);
|
||||||
|
|
||||||
if (apiClient && !apiClient.isWebSocketOpen()) {
|
if (apiClient && apiClient.isLoggedIn() && !apiClient.isWebSocketOpen()) {
|
||||||
Dashboard.refreshSystemInfoFromServer();
|
Dashboard.refreshSystemInfoFromServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue