0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-24 22:05:56 -05:00

fix(console): provide fallback value for language field in settings

This commit is contained in:
Charles Zhao 2022-07-08 17:32:11 +08:00
parent 800f04744d
commit 5ad5eb2ad9
No known key found for this signature in database
GPG key ID: 4858774754C92DF2

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,