mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-10-21 09:08:32 +00:00
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:
@@ -1,8 +1,9 @@
|
||||
import { nls } from '@theia/core/lib/common';
|
||||
import React from '@theia/core/shared/react';
|
||||
import type {
|
||||
BoardList,
|
||||
BoardListItemWithBoard,
|
||||
import {
|
||||
boardListItemEquals,
|
||||
type BoardList,
|
||||
type BoardListItemWithBoard,
|
||||
} from '../../../common/protocol/board-list';
|
||||
import { ArduinoSelect } from '../../widgets/arduino-select';
|
||||
|
||||
@@ -75,7 +76,9 @@ export const SelectBoardComponent = ({
|
||||
setSelectOptions(boardOptions);
|
||||
|
||||
if (selectedItem) {
|
||||
selBoard = updatableBoards.indexOf(selectedItem);
|
||||
selBoard = updatableBoards.findIndex((board) =>
|
||||
boardListItemEquals(board, selectedItem)
|
||||
);
|
||||
}
|
||||
|
||||
selectOption(boardOptions[selBoard] || null);
|
||||
|
Reference in New Issue
Block a user