From 6ec256154e1ba1c817dc49bdd0573f35b9c8cf2b Mon Sep 17 00:00:00 2001 From: MrTimscampi Date: Sat, 25 Apr 2020 12:06:58 +0200 Subject: [PATCH] Check appSettings for undefined Prevents infinite loading on the Playback settings page --- src/scripts/settings/appSettings.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/scripts/settings/appSettings.js b/src/scripts/settings/appSettings.js index 03ceb346a2..dd2f972a30 100644 --- a/src/scripts/settings/appSettings.js +++ b/src/scripts/settings/appSettings.js @@ -12,7 +12,7 @@ import events from 'events'; } export function enableAutoLogin(val) { - if (val != null) { + if (val !== undefined || null) { this.set('enableAutoLogin', val.toString()); } @@ -20,7 +20,7 @@ import events from 'events'; } export function enableSystemExternalPlayers(val) { - if (val !== null) { + if (val !== undefined || null) { this.set('enableSystemExternalPlayers', val.toString()); } @@ -29,7 +29,7 @@ import events from 'events'; export function enableAutomaticBitrateDetection(isInNetwork, mediaType, val) { var key = 'enableautobitratebitrate-' + mediaType + '-' + isInNetwork; - if (val != null) { + if (val !== undefined || null) { if (isInNetwork && mediaType === 'Audio') { val = true; } @@ -46,7 +46,7 @@ import events from 'events'; export function maxStreamingBitrate(isInNetwork, mediaType, val) { var key = 'maxbitrate-' + mediaType + '-' + isInNetwork; - if (val != null) { + if (val !== undefined || null) { if (isInNetwork && mediaType === 'Audio') { // nothing to do, this is always a max value } else { @@ -63,7 +63,7 @@ import events from 'events'; } export function maxStaticMusicBitrate(val) { - if (val !== undefined) { + if (val !== undefined || null) { this.set('maxStaticMusicBitrate', val); } @@ -72,7 +72,7 @@ import events from 'events'; } export function maxChromecastBitrate(val) { - if (val != null) { + if (val !== undefined || null) { this.set('chromecastBitrate1', val); } @@ -81,7 +81,7 @@ import events from 'events'; } export function syncOnlyOnWifi(val) { - if (val != null) { + if (val !== undefined || null) { this.set('syncOnlyOnWifi', val.toString()); } @@ -89,7 +89,7 @@ import events from 'events'; } export function syncPath(val) { - if (val != null) { + if (val !== undefined || null) { this.set('syncPath', val); } @@ -97,7 +97,7 @@ import events from 'events'; } export function cameraUploadServers(val) { - if (val != null) { + if (val !== undefined || null) { this.set('cameraUploadServers', val.join(',')); } @@ -110,7 +110,7 @@ import events from 'events'; } export function runAtStartup(val) { - if (val != null) { + if (val !== undefined || null) { this.set('runatstartup', val.toString()); }