Skip to content

Commit a529441

Browse files
committed
Made boards selector async
Signed-off-by: jbicker <jan.bicker@typefox.io>
1 parent 83e966d commit a529441

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

arduino-ide-extension/src/browser/boards/boards-toolbar-item.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ export class BoardsToolBarItem extends React.Component<BoardsToolBarItem.Props,
139139
}
140140

141141
protected async setAttachedBoards() {
142-
const { boards } = await this.props.boardService.getAttachedBoards();
143-
this.attachedBoards = boards;
144-
if (this.attachedBoards.length) {
145-
await this.createBoardDropdownItems();
146-
await this.props.boardService.selectBoard(this.attachedBoards[0]);
147-
this.setSelectedBoard(this.attachedBoards[0]);
148-
}
142+
this.props.boardService.getAttachedBoards().then(attachedBoards => {
143+
this.attachedBoards = attachedBoards.boards;
144+
if (this.attachedBoards.length) {
145+
this.createBoardDropdownItems();
146+
this.props.boardService.selectBoard(this.attachedBoards[0]).then(() => this.setSelectedBoard(this.attachedBoards[0]));
147+
}
148+
})
149149
}
150150

151151
protected createBoardDropdownItems() {

0 commit comments

Comments
 (0)