mirror of
https://github.com/logto-io/logto.git
synced 2025-01-27 21:39:16 -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:
commit
5b0766f0a5
1 changed files with 5 additions and 1 deletions
|
@ -41,6 +41,10 @@ const Settings = () => {
|
||||||
toast.success(t('general.saved'));
|
toast.success(t('general.saved'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const defaultLanguage = Object.values<string>(Language).includes(language)
|
||||||
|
? language
|
||||||
|
: Language.English;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className={classNames(detailsStyles.container, styles.container)}>
|
<Card className={classNames(detailsStyles.container, styles.container)}>
|
||||||
<CardTitle title="settings.title" subtitle="settings.description" />
|
<CardTitle title="settings.title" subtitle="settings.description" />
|
||||||
|
@ -58,7 +62,7 @@ const Settings = () => {
|
||||||
control={control}
|
control={control}
|
||||||
render={({ field: { value, onChange } }) => (
|
render={({ field: { value, onChange } }) => (
|
||||||
<Select
|
<Select
|
||||||
value={value ?? language}
|
value={value ?? defaultLanguage}
|
||||||
options={[
|
options={[
|
||||||
{
|
{
|
||||||
value: Language.English,
|
value: Language.English,
|
||||||
|
|
Loading…
Add table
Reference in a new issue