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

remove autosave and update variable declerations

This commit is contained in:
Cameron 2020-07-11 14:57:41 +01:00
parent 8af1142000
commit df2af2a6ef
4 changed files with 20 additions and 41 deletions

View file

@ -18,10 +18,10 @@ import 'listViewStyle';
}
}
var homescreenSettingsInstance;
var hasChanges;
var userId = params.userId || ApiClient.getCurrentUserId();
var currentSettings = userId === ApiClient.getCurrentUserId() ? userSettings : new UserSettings();
let homescreenSettingsInstance;
let hasChanges;
const userId = params.userId || ApiClient.getCurrentUserId();
const currentSettings = userId === ApiClient.getCurrentUserId() ? userSettings : new UserSettings();
view.addEventListener('viewshow', function () {
window.addEventListener('beforeunload', onBeforeUnload);
@ -39,16 +39,11 @@ import 'listViewStyle';
});
}
});
view.addEventListener('change', function () {
hasChanges = true;
});
view.addEventListener('viewbeforehide', function () {
hasChanges = false;
if (homescreenSettingsInstance) {
homescreenSettingsInstance.submit();
}
});
view.addEventListener('viewdestroy', function () {
if (homescreenSettingsInstance) {
homescreenSettingsInstance.destroy();