@@ -50,6 +50,7 @@ export const useVsCodeStore = defineStore('vsCode', {
5050 librariesInstalled : null as Liblist | null ,
5151 boardExamples : null as Liblist | null ,
5252 boardExamplesError : "" as string ,
53+ boardExamplesBoard : "" as string ,
5354 libariesInformation : null as LibraryInformation [ ] | null ,
5455 additionalBoardURLs : null as string | null ,
5556 outdated : null as Outdated | null ,
@@ -306,7 +307,17 @@ export const useVsCodeStore = defineStore('vsCode', {
306307 handleMessage ( message : WebviewToExtensionMessage ) {
307308 switch ( message . command ) {
308309 case ARDUINO_MESSAGES . ARDUINO_PROJECT_INFO :
310+ const previousBoard = this . projectInfo ?. board ?? "" ;
309311 this . projectInfo = message . payload ;
312+ const nextBoard = this . projectInfo ?. board ?? "" ;
313+ if ( previousBoard !== nextBoard ) {
314+ this . boardExamples = null ;
315+ this . boardExamplesError = "" ;
316+ this . boardExamplesBoard = nextBoard ;
317+ if ( nextBoard ) {
318+ this . sendMessage ( { command : ARDUINO_MESSAGES . CLI_BOARD_EXAMPLES , errorMessage : "" , payload : "" } ) ;
319+ }
320+ }
310321 if ( this . projectInfo ?. board ) {
311322 this . sendMessage ( { command : ARDUINO_MESSAGES . CLI_BOARD_OPTIONS , errorMessage : "" , payload : this . projectInfo . board } ) ;
312323 }
0 commit comments