File tree 1 file changed +10
-3
lines changed
arduino-ide-extension/src/browser/monitor
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,8 @@ export class MonitorWidget extends ReactWidget implements StatefulWidget {
131
131
132
132
protected widgetHeight : number ;
133
133
134
+ protected continuePreviousConnection : boolean ;
135
+
134
136
constructor (
135
137
@inject ( MonitorServiceClientImpl ) protected readonly serviceClient : MonitorServiceClientImpl ,
136
138
@inject ( MonitorConnection ) protected readonly connection : MonitorConnection ,
@@ -204,13 +206,18 @@ export class MonitorWidget extends ReactWidget implements StatefulWidget {
204
206
}
205
207
return false ;
206
208
} ) ;
207
- if ( ! connectedBoard ) {
208
- this . close ( ) ;
209
+ if ( connectedBoard && currentConnectionConfig ) {
210
+ this . continuePreviousConnection = true ;
211
+ this . connection . connect ( currentConnectionConfig ) ;
209
212
}
210
213
} ) ) ;
211
214
212
215
this . toDisposeOnDetach . push ( this . connection . onConnectionChanged ( ( ) => {
213
- this . clear ( ) ;
216
+ if ( ! this . continuePreviousConnection ) {
217
+ this . clear ( ) ;
218
+ } else {
219
+ this . continuePreviousConnection = false ;
220
+ }
214
221
} ) ) ;
215
222
}
216
223
You can’t perform that action at this time.
0 commit comments