8000 fix: use board+port at startup if it's restored by kittaakos · Pull Request #2242 · arduino/arduino-ide · GitHub
[go: up one dir, main page]

Skip to content

fix: use board+port at startup if it's restored #2242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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>
  • Loading branch information
Akos Kitta committed Sep 29, 2023
commit db83ed095bed5cc0151cac4f006581ec2f660a08
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,18 @@ export class SelectedBoard extends Contribution {
private readonly boardsServiceProvider: BoardsServiceProvider;

override onStart(): void {
this.boardsServiceProvider.onBoardListDidChange(() =>
this.update(this.boardsServiceProvider.boardList)
this.boardsServiceProvider.onBoardListDidChange((boardList) =>
this.update(boardList)
);
}

override onReady(): void {
this.update(this.boardsServiceProvider.boardList);
this.boardsServiceProvider.ready.then(() => this.update());
}

private update(boardList: BoardList): void {
private update(
boardList: BoardList = this.boardsServiceProvider.boardList
): void {
const { selectedBoard, selectedPort } = boardList.boardsConfig;
this.statusBar.setElement('arduino-selected-board', {
alignment: StatusBarAlignment.RIGHT,
Expand Down
0