Skip to content

Build your personal knowledge base with Trilium Notes

client: Fix flakiness when changing language on desktop

Elian Doran221fc66ca15c
diff --git a/src/public/app/components/app_context.js b/src/public/app/components/app_context.js
index 3981c46c12..04c11e8b7b 100644
--- a/src/public/app/components/app_context.js
+++ b/src/public/app/components/app_context.js
@@ -30,7 +30,7 @@ class AppContext extends Component {
*/
async earlyInit() {
await options.initializedPromise;
- initLocale();
+ await initLocale();
}
setLayout(layout) {
diff --git a/src/public/app/desktop.js b/src/public/app/desktop.js
index 235502f316..febb9a8f93 100644
--- a/src/public/app/desktop.js
+++ b/src/public/app/desktop.js
@@ -10,7 +10,7 @@ import glob from "./services/glob.js";
import { t } from "./services/i18n.js";
bundleService.getWidgetBundlesByParent().then(async widgetBundles => {
- appContext.earlyInit();
+ await appContext.earlyInit();
// A dynamic import is required for layouts since they initialize components which require translations.
const DesktopLayout = (await import("./layouts/desktop_layout.js")).default;