Skip to content

Commit

Permalink
Fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jfdoming committed Jan 8, 2025
1 parent 40d8686 commit 574a871
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@ const languageOptions: SelectOption[] = [
['', 'System default'] as [string, string],
Menu.line as typeof Menu.line,
].concat(
availableLanguages.map(
lang =>
[
lang,
new Intl.DisplayNames([lang], {
type: 'language',
}).of(lang),
] as const,
),
availableLanguages.map(lang => [
lang,
new Intl.DisplayNames([lang], {
type: 'language',
}).of(lang) || lang,
]),
);

export function LanguageSettings() {
Expand All @@ -34,7 +31,7 @@ export function LanguageSettings() {
primaryAction={
<Select
options={languageOptions}
value={isEnabled ? language : 'not-available'}
value={isEnabled ? (language ?? '') : 'not-available'}
defaultLabel={
isEnabled ? 'Select language' : 'No languages available'
}
Expand Down

0 comments on commit 574a871

Please sign in to comment.