mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
fix(console): language select box initial value should not be empty
This commit is contained in:
parent
c9286dcda2
commit
26f47d873d
1 changed files with 5 additions and 1 deletions
|
@ -41,6 +41,10 @@ const Settings = () => {
|
|||
toast.success(t('general.saved'));
|
||||
});
|
||||
|
||||
const defaultLanguage = Object.values<string>(Language).includes(language)
|
||||
? language
|
||||
: Language.English;
|
||||
|
||||
return (
|
||||
<Card className={classNames(detailsStyles.container, styles.container)}>
|
||||
<CardTitle title="settings.title" subtitle="settings.description" />
|
||||
|
@ -58,7 +62,7 @@ const Settings = () => {
|
|||
control={control}
|
||||
render={({ field: { value, onChange } }) => (
|
||||
<Select
|
||||
value={value ?? language}
|
||||
value={value ?? defaultLanguage}
|
||||
options={[
|
||||
{
|
||||
value: Language.English,
|
||||
|
|
Loading…
Reference in a new issue