fix: setting $effect wouldn't update

This commit is contained in:
Xylight committed 2024-10-26 11:25:59 -07:00
1 parent c75e0cc4b7
commit c7e2963390
3 files changed
+15 -9

No files matched your search

+1 -1
View File
@@ -44,7 +44,7 @@
size = 'md',
id = generateID(),
rows = 4,
element = $bindable(undefined),
element = $bindable(),
class: clazz = '',
customLabel,
suffix,
+13 -7
View File
@@ -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 () => {
}
})
+1 -1
View File
@@ -111,6 +111,6 @@ export const aliases = new Map([
['he-IL', 'he'],
])
export const { t, locale, locales, loading, loadTranslations } = new i18n(
export let { t, locale, locales, loading, loadTranslations } = new i18n(
config
)