mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #1897 from Camc314/fix-prevent-reload
Fix Message Appearing on Page Reload
This commit is contained in:
commit
40ba77b638
4 changed files with 8 additions and 32 deletions
|
@ -8,19 +8,13 @@ import autoFocuser from 'autoFocuser';
|
|||
const UserSettings = userSettings.UserSettings;
|
||||
|
||||
export default function (view, params) {
|
||||
function onBeforeUnload(e) {
|
||||
if (hasChanges) {
|
||||
e.returnValue = 'You currently have unsaved changes. Are you sure you wish to leave?';
|
||||
}
|
||||
}
|
||||
|
||||
let settingsInstance;
|
||||
let hasChanges;
|
||||
|
||||
const userId = params.userId || ApiClient.getCurrentUserId();
|
||||
const currentSettings = userId === ApiClient.getCurrentUserId() ? userSettings : new UserSettings();
|
||||
view.addEventListener('viewshow', function () {
|
||||
window.addEventListener('beforeunload', onBeforeUnload);
|
||||
|
||||
view.addEventListener('viewshow', function () {
|
||||
if (settingsInstance) {
|
||||
settingsInstance.loadData();
|
||||
} else {
|
||||
|
|
|
@ -9,19 +9,13 @@ import 'listViewStyle';
|
|||
const UserSettings = userSettings.UserSettings;
|
||||
|
||||
export default function (view, params) {
|
||||
function onBeforeUnload(e) {
|
||||
if (hasChanges) {
|
||||
e.returnValue = 'You currently have unsaved changes. Are you sure you wish to leave?';
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
view.addEventListener('viewshow', function () {
|
||||
if (homescreenSettingsInstance) {
|
||||
homescreenSettingsInstance.loadData();
|
||||
} else {
|
||||
|
|
|
@ -9,19 +9,13 @@ import 'listViewStyle';
|
|||
const UserSettings = userSettings.UserSettings;
|
||||
|
||||
export default function (view, params) {
|
||||
function onBeforeUnload(e) {
|
||||
if (hasChanges) {
|
||||
e.returnValue = 'You currently have unsaved changes. Are you sure you wish to leave?';
|
||||
}
|
||||
}
|
||||
|
||||
let settingsInstance;
|
||||
let hasChanges;
|
||||
|
||||
const userId = params.userId || ApiClient.getCurrentUserId();
|
||||
const currentSettings = userId === ApiClient.getCurrentUserId() ? userSettings : new UserSettings();
|
||||
view.addEventListener('viewshow', function () {
|
||||
window.addEventListener('beforeunload', onBeforeUnload);
|
||||
|
||||
view.addEventListener('viewshow', function () {
|
||||
if (settingsInstance) {
|
||||
settingsInstance.loadData();
|
||||
} else {
|
||||
|
|
|
@ -8,19 +8,13 @@ import autoFocuser from 'autoFocuser';
|
|||
const UserSettings = userSettings.UserSettings;
|
||||
|
||||
export default function (view, params) {
|
||||
function onBeforeUnload(e) {
|
||||
if (hasChanges) {
|
||||
e.returnValue = 'You currently have unsaved changes. Are you sure you wish to leave?';
|
||||
}
|
||||
}
|
||||
|
||||
let subtitleSettingsInstance;
|
||||
let hasChanges;
|
||||
|
||||
const userId = params.userId || ApiClient.getCurrentUserId();
|
||||
const currentSettings = userId === ApiClient.getCurrentUserId() ? userSettings : new UserSettings();
|
||||
view.addEventListener('viewshow', function () {
|
||||
window.addEventListener('beforeunload', onBeforeUnload);
|
||||
|
||||
view.addEventListener('viewshow', function () {
|
||||
if (subtitleSettingsInstance) {
|
||||
subtitleSettingsInstance.loadData();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue