Initialize locale
earlier to avoid races
This commit is contained in:
parent
29b4148889
commit
599c7afe8b
1 changed files with 6 additions and 6 deletions
12
app/main.ts
12
app/main.ts
|
@ -1371,6 +1371,12 @@ app.on('ready', async () => {
|
||||||
|
|
||||||
logger = await logging.initialize(getMainWindow);
|
logger = await logging.initialize(getMainWindow);
|
||||||
|
|
||||||
|
if (!locale) {
|
||||||
|
const appLocale =
|
||||||
|
getEnvironment() === Environment.Test ? 'en' : app.getLocale();
|
||||||
|
locale = loadLocale({ appLocale, logger });
|
||||||
|
}
|
||||||
|
|
||||||
sqlInitPromise = initializeSQL(userDataPath);
|
sqlInitPromise = initializeSQL(userDataPath);
|
||||||
|
|
||||||
const startTime = Date.now();
|
const startTime = Date.now();
|
||||||
|
@ -1448,12 +1454,6 @@ app.on('ready', async () => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!locale) {
|
|
||||||
const appLocale =
|
|
||||||
getEnvironment() === Environment.Test ? 'en' : app.getLocale();
|
|
||||||
locale = loadLocale({ appLocale, logger });
|
|
||||||
}
|
|
||||||
|
|
||||||
GlobalErrors.updateLocale(locale.messages);
|
GlobalErrors.updateLocale(locale.messages);
|
||||||
|
|
||||||
// If the sql initialization takes more than three seconds to complete, we
|
// If the sql initialization takes more than three seconds to complete, we
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue