Merge pull request #953 from hydralauncher/fix/add-language-migration

feat: add language migration
This commit is contained in:
Chubby Granny Chaser 2024-09-14 00:19:38 +01:00 committed by GitHub
commit 7846ecbd4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 3 deletions

View file

@ -41,8 +41,11 @@ i18n
escapeValue: false,
},
})
.then(() => {
window.electron.updateUserPreferences({ language: i18n.language });
.then(async () => {
const userPreferences = await window.electron.getUserPreferences();
if (!userPreferences?.language) {
window.electron.updateUserPreferences({ language: i18n.language });
}
});
ReactDOM.createRoot(document.getElementById("root")!).render(