Skip to content

Commit

Permalink
fix(console): language select box initial value should not be empty
Browse files Browse the repository at this point in the history
  • Loading branch information
charIeszhao committed Jul 15, 2022
1 parent c9286dc commit 26f47d8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/console/src/pages/Settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand All @@ -58,7 +62,7 @@ const Settings = () => {
control={control}
render={({ field: { value, onChange } }) => (
<Select
value={value ?? language}
value={value ?? defaultLanguage}
options={[
{
value: Language.English,
Expand Down

0 comments on commit 26f47d8

Please sign in to comment.