Fix editing other user settings

This commit is contained in:
Bill Thornton 2020-03-05 00:04:41 -05:00
parent 1bcd33e011
commit ea8007428e
6 changed files with 13 additions and 10 deletions

View File

@ -1,4 +1,4 @@
define(["displaySettings", "userSettings", "autoFocuser"], function (DisplaySettings, currentUserSettings, autoFocuser) {
define(["displaySettings", "userSettingsBuilder", "userSettings", "autoFocuser"], function (DisplaySettings, userSettingsBuilder, currentUserSettings, autoFocuser) {
"use strict";
return function (view, params) {
@ -11,7 +11,7 @@ define(["displaySettings", "userSettings", "autoFocuser"], function (DisplaySett
var settingsInstance;
var hasChanges;
var userId = params.userId || ApiClient.getCurrentUserId();
var userSettings = userId === ApiClient.getCurrentUserId() ? currentUserSettings : new userSettings();
var userSettings = userId === ApiClient.getCurrentUserId() ? currentUserSettings : new userSettingsBuilder();
view.addEventListener("viewshow", function () {
window.addEventListener("beforeunload", onBeforeUnload);

View File

@ -1,4 +1,4 @@
define(["homescreenSettings", "dom", "globalize", "loading", "userSettings", "autoFocuser", "listViewStyle"], function (HomescreenSettings, dom, globalize, loading, currentUserSettings, autoFocuser) {
define(["homescreenSettings", "userSettingsBuilder", "dom", "globalize", "loading", "userSettings", "autoFocuser", "listViewStyle"], function (HomescreenSettings, userSettingsBuilder, dom, globalize, loading, currentUserSettings, autoFocuser) {
"use strict";
return function (view, params) {
@ -11,7 +11,7 @@ define(["homescreenSettings", "dom", "globalize", "loading", "userSettings", "au
var homescreenSettingsInstance;
var hasChanges;
var userId = params.userId || ApiClient.getCurrentUserId();
var userSettings = userId === ApiClient.getCurrentUserId() ? currentUserSettings : new userSettings();
var userSettings = userId === ApiClient.getCurrentUserId() ? currentUserSettings : new userSettingsBuilder();
view.addEventListener("viewshow", function () {
window.addEventListener("beforeunload", onBeforeUnload);

View File

@ -1,4 +1,4 @@
define(["playbackSettings", "dom", "globalize", "loading", "userSettings", "autoFocuser", "listViewStyle"], function (PlaybackSettings, dom, globalize, loading, currentUserSettings, autoFocuser) {
define(["playbackSettings", "userSettingsBuilder", "dom", "globalize", "loading", "userSettings", "autoFocuser", "listViewStyle"], function (PlaybackSettings, userSettingsBuilder, dom, globalize, loading, currentUserSettings, autoFocuser) {
"use strict";
return function (view, params) {
@ -11,7 +11,7 @@ define(["playbackSettings", "dom", "globalize", "loading", "userSettings", "auto
var settingsInstance;
var hasChanges;
var userId = params.userId || ApiClient.getCurrentUserId();
var userSettings = userId === ApiClient.getCurrentUserId() ? currentUserSettings : new userSettings();
var userSettings = userId === ApiClient.getCurrentUserId() ? currentUserSettings : new userSettingsBuilder();
view.addEventListener("viewshow", function () {
window.addEventListener("beforeunload", onBeforeUnload);

View File

@ -1,4 +1,4 @@
define(["subtitleSettings", "userSettings", "autoFocuser"], function (SubtitleSettings, currentUserSettings, autoFocuser) {
define(["subtitleSettings", "userSettingsBuilder", "userSettings", "autoFocuser"], function (SubtitleSettings, userSettingsBuilder, currentUserSettings, autoFocuser) {
"use strict";
return function (view, params) {
@ -11,7 +11,7 @@ define(["subtitleSettings", "userSettings", "autoFocuser"], function (SubtitleSe
var subtitleSettingsInstance;
var hasChanges;
var userId = params.userId || ApiClient.getCurrentUserId();
var userSettings = userId === ApiClient.getCurrentUserId() ? currentUserSettings : new userSettings();
var userSettings = userId === ApiClient.getCurrentUserId() ? currentUserSettings : new userSettingsBuilder();
view.addEventListener("viewshow", function () {
window.addEventListener("beforeunload", onBeforeUnload);

View File

@ -251,5 +251,5 @@ define(['appSettings', 'events'], function (appSettings, events) {
return this.get(key, true);
};
return new UserSettings();
return UserSettings;
});

View File

@ -812,7 +812,10 @@ var AppInfo = {};
define("emby-toggle", [elementsPath + "/emby-toggle/emby-toggle"], returnFirstDependency);
define("appSettings", [scriptsPath + "/settings/appSettings"], returnFirstDependency);
define("userSettings", [scriptsPath + "/settings/userSettings"], returnFirstDependency);
define("userSettingsBuilder", [scriptsPath + "/settings/userSettingsBuilder"], returnFirstDependency);
define("userSettings", ["userSettingsBuilder"], function(userSettingsBuilder) {
return new userSettingsBuilder();
});
define("chromecastHelper", [componentsPath + "/chromecast/chromecasthelpers"], returnFirstDependency);
define("mediaSession", [componentsPath + "/playback/mediasession"], returnFirstDependency);