mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-16 05:39:28 +00:00
fix: use board+port at startup if it's restored (#2242)
- update status bar if board+port is restored, - refresh the debug toolbar if board+port is restored, - init `Include Library` if board+port is ready, and - init library examples if board+port is ready Closes #2237 Closes #2239 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user