mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
make auto saving conditional
This commit is contained in:
parent
24a456b877
commit
9fb1452f93
7 changed files with 90 additions and 11 deletions
|
@ -25,16 +25,29 @@
|
|||
appStorage.setItem('enableThemeSongs-' + user.Id, $('#selectThemeSong', page).val());
|
||||
appStorage.setItem('enableBackdrops-' + user.Id, $('#selectBackdrop', page).val());
|
||||
|
||||
ApiClient.updateUserConfiguration(user.Id, user.Configuration);
|
||||
return ApiClient.updateUserConfiguration(user.Id, user.Configuration);
|
||||
}
|
||||
|
||||
function save(page) {
|
||||
|
||||
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
|
||||
|
||||
if (!AppInfo.enableAutoSave) {
|
||||
Dashboard.showLoadingMsg();
|
||||
}
|
||||
|
||||
ApiClient.getUser(userId).then(function (user) {
|
||||
|
||||
saveUser(page, user);
|
||||
saveUser(page, user).then(function () {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
if (!AppInfo.enableAutoSave) {
|
||||
Dashboard.alert(Globalize.translate('SettingsSaved'));
|
||||
}
|
||||
|
||||
}, function () {
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
@ -55,6 +68,12 @@
|
|||
|
||||
$('.displayPreferencesForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||
|
||||
if (AppInfo.enableAutoSave) {
|
||||
page.querySelector('.btnSave').classList.add('hide');
|
||||
} else {
|
||||
page.querySelector('.btnSave').classList.remove('hide');
|
||||
}
|
||||
|
||||
});
|
||||
pageIdOn('pageshow', "displayPreferencesPage", function () {
|
||||
|
||||
|
@ -88,7 +107,9 @@
|
|||
|
||||
var page = this;
|
||||
|
||||
save(page);
|
||||
if (AppInfo.enableAutoSave) {
|
||||
save(page);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue