fixed: fixed unexpected error during startup

This commit is contained in:
vorotamoroz
2026-05-13 10:14:47 +00:00
parent 95dc079fad
commit df79d81475
2 changed files with 10 additions and 3 deletions

View File

@@ -61,10 +61,12 @@ export class ModuleLiveSyncMain extends AbstractModule {
eventHub.onEvent(EVENT_SETTING_SAVED, (settings: ObsidianLiveSyncSettings) => {
fireAndForget(async () => {
try {
await this.core.services.control.applySettings();
const lang = this.core.services.setting.currentSettings()?.displayLanguage ?? undefined;
const lang = this.core.services.setting.currentSettings()?.displayLanguage;
if (lang !== undefined) {
setLang(this.core.services.setting.currentSettings()?.displayLanguage);
setLang(lang);
}
if (this.core.services.database.isDatabaseReady()) {
await this.core.services.control.applySettings();
}
eventHub.emitEvent(EVENT_REQUEST_RELOAD_SETTING_TAB);
} catch (e) {