fix: setting $effect wouldn't update
This commit is contained in:
1 parent
c75e0cc4b7
commit
c7e2963390
3 files changed
+15
-9
No files matched your search
@@ -212,12 +212,18 @@ if (typeof window != 'undefined') {
|
||||
}
|
||||
|
||||
$effect.root(() => {
|
||||
if (typeof window != 'undefined') {
|
||||
localStorage.setItem('settings', JSON.stringify(settings))
|
||||
}
|
||||
if (settings.language) {
|
||||
locale.set(settings.language)
|
||||
} else {
|
||||
if (browser) locale.set(navigator?.language)
|
||||
$effect(() => {
|
||||
if (typeof window != 'undefined') {
|
||||
localStorage.setItem('settings', JSON.stringify(settings))
|
||||
}
|
||||
if (settings.language) {
|
||||
locale.set(settings.language)
|
||||
} else {
|
||||
if (browser) locale.set(navigator?.language)
|
||||
}
|
||||
})
|
||||
|
||||
return () => {
|
||||
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user