Skip to content
Snippets Groups Projects
Commit cef00bb2 authored by Hayley Corson-Dosch's avatar Hayley Corson-Dosch
Browse files

Always update selectedLanguage on route change

parent 551d3838
No related branches found
No related tags found
1 merge request!84Always update selectedLanguage on route change
......@@ -43,9 +43,11 @@ function switchLanguage(lang) {
watch(
() => route.params.lang,
(newLang) => {
// Update selectedLanguage to match route change
selectedLanguage.value = newLang;
// if locale.value does not match newLang, also update it
if (newLang && locale.value !== newLang) {
locale.value = newLang;
selectedLanguage.value = newLang;
}
},
{ immediate: true }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment