Update app/src/ui/dropdown-select-button.tsx

Co-authored-by: Sergio Padrino <sergio.padrino@gmail.com>
This commit is contained in:
tidy-dev 2023-08-25 08:09:44 -04:00 committed by GitHub
parent 26d7ca2050
commit 9280f9df5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -140,10 +140,7 @@ export class DropdownSelectButton extends React.Component<
}
const selectedOption = options.find(o => o.id === selectedValue)
if (selectedOption === undefined) {
return options[0]
}
return selectedOption
return selectedOption ?? options[0]
}
private onItemClick = (