0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-20 21:32:31 -05:00

Merge pull request #1561 from logto-io/charles-log-3732-fix-language-select-box-initial-value-empty

fix(console): language select box initial value should not be empty
This commit is contained in:
Charles Zhao 2022-07-15 23:57:35 +08:00 committed by GitHub
commit 5b0766f0a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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,