modify loadSettings logic to fetch env from DB

This commit is contained in:
Vishnu Sreekumaran Nair committed 2025-05-06 15:57:00 -04:00
1 parent 3e8f3a7a89
commit b493b5e0e5
1 file changed
+8 -5
+8 -5
View File
@@ -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;
}
}
}