From 7bcfabc43c7ca306580570d9996f20bb5e5bdd8a Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 19 Mar 2021 16:10:31 +0100 Subject: [PATCH] Fix an edge-case related to compatibility-values in various `AppOptions`-methods Given how the compatibility-values are being handled, it's not actually possible to override a *truthy* default-value with a *falsy* compatibility-value. This is a simple oversight on my part, and with modern ECMAScript features this is very easy to support. --- web/app_options.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/app_options.js b/web/app_options.js index 21e93ca14..df3d1dc46 100644 --- a/web/app_options.js +++ b/web/app_options.js @@ -297,7 +297,7 @@ class AppOptions { } const defaultOption = defaultOptions[name]; if (defaultOption !== undefined) { - return defaultOption.compatibility || defaultOption.value; + return defaultOption.compatibility ?? defaultOption.value; } return undefined; } @@ -329,7 +329,7 @@ class AppOptions { options[name] = userOption !== undefined ? userOption - : defaultOption.compatibility || defaultOption.value; + : defaultOption.compatibility ?? defaultOption.value; } return options; }