mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-07 19:36:33 +00:00
Merge pull request #41 from bcmi-labs/made-board-selector-async
Made boards selector async
This commit is contained in:
commit
17fab651e5
@ -139,13 +139,13 @@ export class BoardsToolBarItem extends React.Component<BoardsToolBarItem.Props,
|
||||
}
|
||||
|
||||
protected async setAttachedBoards() {
|
||||
const { boards } = await this.props.boardService.getAttachedBoards();
|
||||
this.attachedBoards = boards;
|
||||
if (this.attachedBoards.length) {
|
||||
await this.createBoardDropdownItems();
|
||||
await this.props.boardService.selectBoard(this.attachedBoards[0]);
|
||||
this.setSelectedBoard(this.attachedBoards[0]);
|
||||
}
|
||||
this.props.boardService.getAttachedBoards().then(attachedBoards => {
|
||||
this.attachedBoards = attachedBoards.boards;
|
||||
if (this.attachedBoards.length) {
|
||||
this.createBoardDropdownItems();
|
||||
this.props.boardService.selectBoard(this.attachedBoards[0]).then(() => this.setSelectedBoard(this.attachedBoards[0]));
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
protected createBoardDropdownItems() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user