fix(web): persisted store (#18385)

* fix(web): persisted store

* fix: translation

* fix: test

* fix: test

* revert i18n changes

* fix blank locale
This commit is contained in:
Daimolean
2025-06-04 03:27:23 +08:00
committed by GitHub
parent 6b4d5e3beb
commit daf1bee7ac
7 changed files with 64 additions and 40 deletions
+2 -2
View File
@@ -9,9 +9,9 @@ export interface ThemeSetting {
}
// Locale to use for formatting dates, numbers, etc.
export const locale = persisted<string | undefined>('locale', undefined, {
export const locale = persisted<string | undefined>('locale', 'default', {
serializer: {
parse: (text) => (text == '' ? 'en-US' : text),
parse: (text) => text || 'default',
stringify: (object) => object ?? '',
},
});