initialize missing settings

This commit is contained in:
vcoppe
2025-11-09 18:45:20 +01:00
parent 59710d2e1a
commit 39b8d2e70d
2 changed files with 15 additions and 2 deletions

View File

@@ -98,6 +98,10 @@ export class SettingInitOnFirstRead<V> {
});
}
initialize() {
this.set(this._initial);
}
disconnectFromDatabase() {
this._subscription?.unsubscribe();
this._subscription = null;
@@ -174,4 +178,12 @@ export const settings = {
}
}
},
initialize() {
for (const key in settings) {
const setting = (settings as any)[key];
if (setting instanceof SettingInitOnFirstRead) {
setting.initialize();
}
}
},
};