mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-08 11:56:36 +00:00
Made boards selector async
Signed-off-by: jbicker <jan.bicker@typefox.io>
This commit is contained in:
parent
83e966d208
commit
a5294417c3
@ -139,13 +139,13 @@ export class BoardsToolBarItem extends React.Component<BoardsToolBarItem.Props,
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected async setAttachedBoards() {
|
protected async setAttachedBoards() {
|
||||||
const { boards } = await this.props.boardService.getAttachedBoards();
|
this.props.boardService.getAttachedBoards().then(attachedBoards => {
|
||||||
this.attachedBoards = boards;
|
this.attachedBoards = attachedBoards.boards;
|
||||||
if (this.attachedBoards.length) {
|
if (this.attachedBoards.length) {
|
||||||
await this.createBoardDropdownItems();
|
this.createBoardDropdownItems();
|
||||||
await this.props.boardService.selectBoard(this.attachedBoards[0]);
|
this.props.boardService.selectBoard(this.attachedBoards[0]).then(() => this.setSelectedBoard(this.attachedBoards[0]));
|
||||||
this.setSelectedBoard(this.attachedBoards[0]);
|
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
protected createBoardDropdownItems() {
|
protected createBoardDropdownItems() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user