From 7866bfc7399f0dd5b22b3bc9a9d7376c54c38f6e 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..4e575430b 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); // TODO: verify! + }); this.updateSketchPath(this.sketchServiceClient.tryGetCurrentSketch()); this.updateUserDirPath(this.configService.tryGetSketchDirUri()); this.updateDataDirPath(this.configService.tryGetDataDirUri());