diff --git a/shared/js/settings.ts b/shared/js/settings.ts index 13615f9f..8b29bbb9 100644 --- a/shared/js/settings.ts +++ b/shared/js/settings.ts @@ -79,7 +79,6 @@ function resolveKey( resolver: (key: string) => string | undefined, defaultValue: DefaultType ) : ValueType | DefaultType { - let value = resolver(key.key); if(typeof value === "string") { return decodeValueFromString(value, key.valueType); @@ -92,17 +91,14 @@ function resolveKey( continue; } - if(!key.fallbackImports) { - break; + if(key.fallbackImports) { + const fallbackValueImporter = key.fallbackImports[fallback]; + if(fallbackValueImporter) { + return fallbackValueImporter(value); + } } - /* fallback key succeeded */ - const fallbackValueImporter = key.fallbackImports[fallback]; - if(fallbackValueImporter) { - return fallbackValueImporter(value); - } - - break; + return decodeValueFromString(value, key.valueType); } return defaultValue;