0
Fork 0
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:
Charles Zhao 2022-07-15 23:16:38 +08:00
parent c9286dcda2
commit 26f47d873d
No known key found for this signature in database
GPG key ID: 4858774754C92DF2

View file

@ -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,