feat: add language migration

This commit is contained in:
Zamitto 2024-09-13 19:45:37 -03:00
parent 863a3b7d1f
commit 2ea6285744
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(