0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-17 22:04:19 -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';
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 {
handleSubmit,
@ -53,7 +56,7 @@ const Settings = () => {
control={control}
render={({ field: { value, onChange } }) => (
<Select
value={value}
value={value ?? language}
options={[
{
value: Language.English,