Skip to content

Commit

Permalink
fix: set default locale when no local changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ddiu8081 committed May 16, 2023
1 parent 65706ce commit 473aedc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/settings/AppGeneralSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default (props: Props) => {
<SettingsUIComponent
settings={item}
editing={() => true}
value={() => props.settingsValue()[item.key as keyof GeneralSettings] || false}
value={() => props.settingsValue()[item.key as keyof GeneralSettings] || item.default || ''}
setValue={(v) => {
props.updateSettings({ [item.key]: v })
}}
Expand Down
2 changes: 1 addition & 1 deletion src/components/settings/ProviderGlobalSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default ({ config, settingsValue, setSettings }: Props) => {
<SettingsUIComponent
settings={item}
editing={editing}
value={() => formData()[item.key] || ''}
value={() => formData()[item.key]}
setValue={(v) => {
setEditFormData({ ...formData(), [item.key]: v })
}}
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useI18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function useI18n() {
providerSettingsMap.listen((value, changedKey) => {
const general = value[changedKey] as unknown as GeneralSettings
defaultLocale = general?.locale
setCurrentLocale(locales[defaultLocale as string])
defaultLocale && setCurrentLocale(locales[defaultLocale as string])
})

setCurrentLocale(locales[defaultLocale as string])
Expand Down

0 comments on commit 473aedc

Please sign in to comment.