mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
remove dead code
This commit is contained in:
parent
85b918afac
commit
ad885bc1fa
@ -21,28 +21,11 @@
|
|||||||
|
|
||||||
if (data.status == 401) {
|
if (data.status == 401) {
|
||||||
|
|
||||||
var url = data.url.toLowerCase();
|
if (data.errorCode == "ParentalControl") {
|
||||||
|
|
||||||
// Don't bounce to login on failures to contact our external servers
|
var currentView = ViewManager.currentView();
|
||||||
if (url.indexOf('emby.media') != -1 || url.indexOf('mb3admin.com') != -1) {
|
// Bounce to the login screen, but not if a password entry fails, obviously
|
||||||
Dashboard.hideLoadingMsg();
|
if (currentView && !currentView.classList.contains('.standalonePage')) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Don't bounce if the failure is in a sync service
|
|
||||||
if (url.indexOf('/sync') != -1) {
|
|
||||||
Dashboard.hideLoadingMsg();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var currentView = ViewManager.currentView();
|
|
||||||
// Bounce to the login screen, but not if a password entry fails, obviously
|
|
||||||
if (url.indexOf('/password') == -1 &&
|
|
||||||
url.indexOf('/authenticate') == -1 &&
|
|
||||||
currentView &&
|
|
||||||
!currentView.classList.contains('.standalonePage')) {
|
|
||||||
|
|
||||||
if (data.errorCode == "ParentalControl") {
|
|
||||||
|
|
||||||
Dashboard.alert({
|
Dashboard.alert({
|
||||||
message: Globalize.translate('MessageLoggedOutParentalControl'),
|
message: Globalize.translate('MessageLoggedOutParentalControl'),
|
||||||
@ -50,13 +33,9 @@
|
|||||||
Dashboard.logout(false);
|
Dashboard.logout(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
|
||||||
Dashboard.logout(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
Dashboard.hideLoadingMsg();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -3146,32 +3125,5 @@ pageClassOn('viewshow', "page", function () {
|
|||||||
docElem.classList.remove('background-theme-a');
|
docElem.classList.remove('background-theme-a');
|
||||||
}
|
}
|
||||||
|
|
||||||
var apiClient = window.ApiClient;
|
|
||||||
|
|
||||||
Dashboard.ensureHeader(page);
|
Dashboard.ensureHeader(page);
|
||||||
|
|
||||||
if (apiClient && apiClient.isLoggedIn() && !apiClient.isWebSocketOpen()) {
|
|
||||||
Dashboard.refreshSystemInfoFromServer();
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener("beforeunload", function () {
|
|
||||||
|
|
||||||
var apiClient = window.ApiClient;
|
|
||||||
|
|
||||||
// Close the connection gracefully when possible
|
|
||||||
if (apiClient && apiClient.isWebSocketOpen()) {
|
|
||||||
|
|
||||||
var localActivePlayers = MediaController.getPlayers().filter(function (p) {
|
|
||||||
|
|
||||||
return p.isLocalPlayer && p.isPlaying();
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!localActivePlayers.length) {
|
|
||||||
console.log('Sending close web socket command');
|
|
||||||
apiClient.closeWebSocket();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user