From 9f48296d4d37f980eac56d90df9e3008446803d0 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Thu, 21 Sep 2023 15:00:11 +0200 Subject: [PATCH] fix: defer board+port state update for extensions If it is set before the board+port settings are restored from the `localStorage`, extensions will see no board+port. Ref: arduino/arduino-ide#2165 Ref: dankeboy36/esp-exception-decoder#10 Signed-off-by: Akos Kitta --- .../src/browser/contributions/update-arduino-state.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arduino-ide-extension/src/browser/contributions/update-arduino-state.ts b/arduino-ide-extension/src/browser/contributions/update-arduino-state.ts index 35b4c2ab7..e83e46f51 100644 --- a/arduino-ide-extension/src/browser/contributions/update-arduino-state.ts +++ b/arduino-ide-extension/src/browser/contributions/update-arduino-state.ts @@ -76,7 +76,9 @@ export class UpdateArduinoState extends SketchContribution { } override onReady(): void { - this.updateBoardsConfig(this.boardsServiceProvider.boardsConfig); // TODO: verify! + this.boardsServiceProvider.ready.then(() => { + this.updateBoardsConfig(this.boardsServiceProvider.boardsConfig); + }); this.updateSketchPath(this.sketchServiceClient.tryGetCurrentSketch()); this.updateUserDirPath(this.configService.tryGetSketchDirUri()); this.updateDataDirPath(this.configService.tryGetDataDirUri());