fix(front): fix changing language not being saved to the user's settings

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-08-23 16:11:55 +02:00
parent fef60ed0f9
commit 010a5e426d
3 changed files with 14 additions and 9 deletions

View File

@@ -70,14 +70,16 @@ const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
const { loggedUser } = useUserSettings();
const { mutate: doUpdateLocale } = updateLocale();
onMounted(() => {
updateLocale(locale as unknown as string);
doUpdateLocale({ locale: locale as unknown as string });
doUpdateSetting({ timezone });
});
watch(locale, () => {
if (locale.value) {
updateLocale(locale.value as string);
doUpdateLocale({ locale: locale as unknown as string });
saveLocaleData(locale.value as string);
}
});