0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-27 21:39:16 -05:00

Merge pull request #1486 from logto-io/charles-log-3543-provide-fallback-value-for-language-selection-in-settings

fix(console): provide fallback value for language field in settings
This commit is contained in:
Charles Zhao 2022-07-08 17:56:20 +08:00 committed by GitHub
commit b8aea3b407
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,7 +19,10 @@ import ChangePassword from './components/ChangePassword';
import * as styles from './index.module.scss'; import * as styles from './index.module.scss';
const Settings = () => { const Settings = () => {
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' }); const {
t,
i18n: { language },
} = useTranslation(undefined, { keyPrefix: 'admin_console' });
const { data, error, update, isLoading, isLoaded } = useUserPreferences(); const { data, error, update, isLoading, isLoaded } = useUserPreferences();
const { const {
handleSubmit, handleSubmit,
@ -53,7 +56,7 @@ const Settings = () => {
control={control} control={control}
render={({ field: { value, onChange } }) => ( render={({ field: { value, onChange } }) => (
<Select <Select
value={value} value={value ?? language}
options={[ options={[
{ {
value: Language.English, value: Language.English,