Skip to content

Commit db83ed0

Browse files
author
Akos Kitta
committed
fix: update status bar if board+port restored
This is not a functional bug, as this component listens on board list changes, but no unnecessary refresh is needed. Signed-off-by: Akos Kitta <[email protected]>
1 parent ce02e26 commit db83ed0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: arduino-ide-extension/src/browser/contributions/selected-board.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,18 @@ export class SelectedBoard extends Contribution {
1919
private readonly boardsServiceProvider: BoardsServiceProvider;
2020

2121
override onStart(): void {
22-
this.boardsServiceProvider.onBoardListDidChange(() =>
23-
this.update(this.boardsServiceProvider.boardList)
22+
this.boardsServiceProvider.onBoardListDidChange((boardList) =>
23+
this.update(boardList)
2424
);
2525
}
2626

2727
override onReady(): void {
28-
this.update(this.boardsServiceProvider.boardList);
28+
this.boardsServiceProvider.ready.then(() => this.update());
2929
}
3030

31-
private update(boardList: BoardList): void {
31+
private update(
32+
boardList: BoardList = this.boardsServiceProvider.boardList
33+
): void {
3234
const { selectedBoard, selectedPort } = boardList.boardsConfig;
3335
this.statusBar.setElement('arduino-selected-board', {
3436
alignment: StatusBarAlignment.RIGHT,

0 commit comments

Comments
 (0)