Skip to content

Commit 30ee7ab

Browse files
committed
fix: update default value to fix refresh i18n bug
1 parent 42d431d commit 30ee7ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hooks/useI18n.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const buildI18nContext = (locale: Accessor<TranslatePair>): I18nContext =
3131
export function useI18n() {
3232
let defaultLocale = providerSettingsMap.get()?.general?.locale ?? 'en'
3333
providerSettingsMap.listen((value, changedKey) => {
34-
const general = value[changedKey] as unknown as GeneralSettings
34+
const general = value[changedKey ?? 'general'] as unknown as GeneralSettings
3535
defaultLocale = general?.locale
3636
defaultLocale && setCurrentLocale(locales[defaultLocale as string])
3737
})

0 commit comments

Comments
 (0)