diff --git a/src/services/static-config.ts b/src/services/static-config.ts index 0df82e9a..dc2cb3d4 100644 --- a/src/services/static-config.ts +++ b/src/services/static-config.ts @@ -23,8 +23,7 @@ class StaticConfig { private async init() { try { - const res = await axios.get(API.CONFIG_GET()); - this.config = res.data as IConfig; + this.config = (await axios.get(API.CONFIG_GET())).data; } catch (e) { if (!utils.isNetworkError(e)) { showError('Failed to load configuration'); @@ -57,6 +56,13 @@ class StaticConfig { this.setLs(key, this.config[key]); } + // Copy over all missing settings (e.g. local settings) + for (const key in old) { + if (!this.config.hasOwnProperty(key)) { + (this.config as any)[key] = (old as any)[key]; + } + } + // Resolve all promises this.initPromises.forEach((resolve) => resolve()); }