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:
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user