Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit db83ed0

Browse filesBrowse 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 <a.kitta@arduino.cc>
1 parent ce02e26 commit db83ed0
Copy full SHA for db83ed0

File tree

1 file changed

+6
-4
lines changed
Filter options

1 file changed

+6
-4
lines changed

‎arduino-ide-extension/src/browser/contributions/selected-board.ts

Copy file name to clipboardExpand all lines: arduino-ide-extension/src/browser/contributions/selected-board.ts
+6-4Lines changed: 6 additions & 4 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.