@@ -195,22 +195,29 @@ export class MonitorWidget extends ReactWidget implements StatefulWidget {
195
195
super . onAfterAttach ( msg ) ;
196
196
this . clear ( ) ;
197
197
this . connect ( ) ;
198
- this . toDisposeOnDetach . push ( this . boardsServiceClient . onBoardsChanged ( async states => {
199
- const currentConnectionConfig = this . connection . connectionConfig ;
200
- const connectedBoard = states . newState . boards
201
- . filter ( AttachedSerialBoard . is )
202
- . find ( board => {
203
- const potentiallyConnected = currentConnectionConfig && currentConnectionConfig . board ;
204
- if ( AttachedSerialBoard . is ( potentiallyConnected ) ) {
205
- return Board . equals ( board , potentiallyConnected ) && board . port === potentiallyConnected . port ;
206
- }
207
- return false ;
208
- } ) ;
209
- if ( connectedBoard && currentConnectionConfig ) {
210
- this . continuePreviousConnection = true ;
211
- this . connection . connect ( currentConnectionConfig ) ;
212
- }
213
- } ) ) ;
198
+ this . toDisposeOnDetach . push (
199
+ this . boardsServiceClient . onBoardsChanged ( async states => {
200
+ const currentConnectionConfig = this . connection . connectionConfig ;
201
+ const connectedBoard = states . newState . boards
202
+ . filter ( AttachedSerialBoard . is )
203
+ . find ( board => {
204
+ const potentiallyConnected = currentConnectionConfig && currentConnectionConfig . board ;
205
+ if ( AttachedSerialBoard . is ( potentiallyConnected ) ) {
206
+ return Board . equals ( board , potentiallyConnected ) && board . port === potentiallyConnected . port ;
207
+ }
208
+ return false ;
209
+ } ) ;
210
+ if ( connectedBoard && currentConnectionConfig ) {
211
+ this . continuePreviousConnection = true ;
212
+ this . connection . connect ( currentConnectionConfig ) ;
213
+ }
214
+ } )
215
+ ) ;
216
+ this . toDisposeOnDetach . push (
217
+ this . boardsServiceClient . onBoardsConfigChanged ( async boardConfig => {
218
+ this . connect ( ) ;
219
+ } )
220
+ )
214
221
215
222
this . toDisposeOnDetach . push ( this . connection . onConnectionChanged ( ( ) => {
216
223
if ( ! this . continuePreviousConnection ) {
@@ -255,7 +262,6 @@ export class MonitorWidget extends ReactWidget implements StatefulWidget {
255
262
const attachedBoards = await this . boardsService . getAttachedBoards ( ) ;
256
263
const connectedBoard = attachedBoards . boards . filter ( AttachedSerialBoard . is ) . find ( board => BoardsConfig . Config . sameAs ( boardsConfig , board ) ) ;
257
264
if ( ! connectedBoard ) {
258
- this . messageService . warn ( `The selected '${ name } ' board is not connected on ${ selectedPort } .` ) ;
259
265
return ;
260
266
}
261
267
0 commit comments