mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix sonarjs no-collapsible-if
This commit is contained in:
parent
ccdbf0bfc3
commit
1f4e65822b
33 changed files with 330 additions and 473 deletions
|
@ -87,12 +87,10 @@ class AppRouter {
|
|||
|
||||
path = path.replace(this.baseUrl(), '');
|
||||
|
||||
if (this.currentRouteInfo && this.currentRouteInfo.path === path) {
|
||||
// can't use this with home right now due to the back menu
|
||||
if (this.currentRouteInfo.route.type !== 'home') {
|
||||
loading.hide();
|
||||
return Promise.resolve();
|
||||
}
|
||||
// can't use this with home right now due to the back menu
|
||||
if (this.currentRouteInfo?.path === path && this.currentRouteInfo.route.type !== 'home') {
|
||||
loading.hide();
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
this.promiseShow = new Promise((resolve) => {
|
||||
|
@ -351,15 +349,13 @@ class AppRouter {
|
|||
onRequestFail(_e, data) {
|
||||
const apiClient = this;
|
||||
|
||||
if (data.status === 403) {
|
||||
if (data.errorCode === 'ParentalControl') {
|
||||
const isCurrentAllowed = appRouter.currentRouteInfo ? (appRouter.currentRouteInfo.route.anonymous || appRouter.currentRouteInfo.route.startup) : true;
|
||||
if (data.status === 403 && data.errorCode === 'ParentalControl') {
|
||||
const isCurrentAllowed = appRouter.currentRouteInfo ? (appRouter.currentRouteInfo.route.anonymous || appRouter.currentRouteInfo.route.startup) : true;
|
||||
|
||||
// Bounce to the login screen, but not if a password entry fails, obviously
|
||||
if (!isCurrentAllowed) {
|
||||
appRouter.showForcedLogoutMessage(globalize.translate('AccessRestrictedTryAgainLater'));
|
||||
appRouter.showLocalLogin(apiClient.serverId());
|
||||
}
|
||||
// Bounce to the login screen, but not if a password entry fails, obviously
|
||||
if (!isCurrentAllowed) {
|
||||
appRouter.showForcedLogoutMessage(globalize.translate('AccessRestrictedTryAgainLater'));
|
||||
appRouter.showLocalLogin(apiClient.serverId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue