modify loadSettings logic to fetch env from DB
This commit is contained in:
1 parent
3e8f3a7a89
commit
b493b5e0e5
1 file changed
+8
-5
@@ -48,11 +48,14 @@ class SettingsService {
|
||||
|
||||
// If there are any settings that weren't set by environment variables, use user settings from DB
|
||||
for (const key in envConfig) {
|
||||
if (
|
||||
typeof envConfig?.[key] === "undefined" &&
|
||||
typeof dbSettings?.[key] !== "undefined"
|
||||
) {
|
||||
this.settings[key] = dbSettings[key];
|
||||
|
||||
const envValue = envConfig[key];
|
||||
const dbValue = dbSettings?.[key];
|
||||
|
||||
if (envValue === undefined || envValue === "") {
|
||||
if (dbValue !== undefined) {
|
||||
this.settings[key] = dbValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user