Merge pull request #41 from bcmi-labs/made-board-selector-async

Made boards selector async
This commit is contained in:
Jan Bicker 2019-07-25 08:04:02 -07:00 committed by GitHub
commit 17fab651e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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() {