fix: board <select> update on board detach

When the previously selected board is not detected, unset the `<select>`
option.

Closes #2222

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
Akos Kitta
2023-11-22 16:33:01 +01:00
committed by Akos Kitta
parent d01f95647e
commit 0ca1a31747
3 changed files with 9 additions and 4 deletions

View File

@@ -104,6 +104,7 @@ export const FirmwareUploaderComponent = ({
const onItemSelect = React.useCallback(
(item: BoardListItemWithBoard | null) => {
if (!item) {
setSelectedItem(null);
return;
}
const board = item.board;