mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-10 10:58:33 +00:00
simplified monitor connection API.
we have one connenction per editor anyways. Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
@@ -202,7 +202,7 @@ export class MonitorWidget extends ReactWidget {
|
||||
|
||||
protected onBeforeDetach(msg: Message): void {
|
||||
super.onBeforeDetach(msg);
|
||||
if (this.connection.connectionId) {
|
||||
if (this.connection.connected) {
|
||||
this.connection.disconnect();
|
||||
}
|
||||
}
|
||||
@@ -294,9 +294,8 @@ export class MonitorWidget extends ReactWidget {
|
||||
|
||||
protected readonly onSend = (value: string) => this.doSend(value);
|
||||
protected async doSend(value: string) {
|
||||
const { connectionId } = this.connection;
|
||||
if (connectionId) {
|
||||
this.monitorService.send(connectionId, value + this.model.lineEnding);
|
||||
if (this.connection.connected) {
|
||||
this.monitorService.send(value + this.model.lineEnding);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user