mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-08 20:06:32 +00:00
Continue monitoring with last connection if respective board is reconnected
Signed-off-by: jbicker <jan.bicker@typefox.io>
This commit is contained in:
parent
3eebd580d8
commit
2046c0bdee
@ -131,6 +131,8 @@ export class MonitorWidget extends ReactWidget implements StatefulWidget {
|
||||
|
||||
protected widgetHeight: number;
|
||||
|
||||
protected continuePreviousConnection: boolean;
|
||||
|
||||
constructor(
|
||||
@inject(MonitorServiceClientImpl) protected readonly serviceClient: MonitorServiceClientImpl,
|
||||
@inject(MonitorConnection) protected readonly connection: MonitorConnection,
|
||||
@ -204,13 +206,18 @@ export class MonitorWidget extends ReactWidget implements StatefulWidget {
|
||||
}
|
||||
return false;
|
||||
});
|
||||
if (!connectedBoard) {
|
||||
this.close();
|
||||
if (connectedBoard && currentConnectionConfig) {
|
||||
this.continuePreviousConnection = true;
|
||||
this.connection.connect(currentConnectionConfig);
|
||||
}
|
||||
}));
|
||||
|
||||
this.toDisposeOnDetach.push(this.connection.onConnectionChanged(() => {
|
||||
this.clear();
|
||||
if (!this.continuePreviousConnection) {
|
||||
this.clear();
|
||||
} else {
|
||||
this.continuePreviousConnection = false;
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user