1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Only show logout option if user is logged in

This commit is contained in:
RoboMagus 2024-03-09 16:48:17 +01:00
parent 0a42aa1913
commit 4388e5e29a

View file

@ -304,24 +304,26 @@ function askForExit() {
return; return;
} }
import('../components/actionSheet/actionSheet').then((actionsheet) => { import('../scripts/clientUtils').then(() => {
exitPromise = actionsheet.show({ import('../components/actionSheet/actionSheet').then((actionsheet) => {
title: globalize.translate('MessageConfirmAppExit'), const userId = Dashboard.getCurrentUserId();
items: [ const logoutEntry = userId ? [{ id: 'logout', name: globalize.translate('ButtonSignOut') }] : [];
{ id: 'logout', name: globalize.translate('ButtonSignOut') }, exitPromise = actionsheet.show({
{ id: 'yes', name: globalize.translate('Yes') }, title: globalize.translate('MessageConfirmAppExit'),
{ id: 'no', name: globalize.translate('No') } items: [
] ...logoutEntry,
}).then(function (value) { { id: 'yes', name: globalize.translate('Yes') },
if (value === 'yes') { { id: 'no', name: globalize.translate('No') }
doExit(); ]
} else if (value === 'logout') { }).then(function (value) {
import('../scripts/clientUtils').then((clientUtils) => { if (value === 'yes') {
doExit();
} else if (value === 'logout') {
Dashboard.logout(); Dashboard.logout();
}); }
} }).finally(function () {
}).finally(function () { exitPromise = null;
exitPromise = null; });
}); });
}); });
} }