Skip to content

Commit 79d649d

Browse files
author
Akos Kitta
committed
fix: propagate connection status on disconnect
the new connection status was missing from the ws message Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
1 parent 029ddbb commit 79d649d

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

arduino-ide-extension/src/node/monitor-service.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export class MonitorService extends CoreClientAware implements Disposable {
184184
this.updateClientsSettings({
185185
monitorUISettings: {
186186
connectionStatus: 'connected',
187-
connected: true,
187+
connected: true, // TODO: should be removed when plotter app understand the `connectionStatus` message
188188
serialPort: this.port.address,
189189
},
190190
});
@@ -196,7 +196,7 @@ export class MonitorService extends CoreClientAware implements Disposable {
196196
this.updateClientsSettings({
197197
monitorUISettings: {
198198
connectionStatus: 'not-connected',
199-
connected: false,
199+
connected: false, // TODO: should be removed when plotter app understand the `connectionStatus` message
200200
},
201201
});
202202

@@ -268,7 +268,7 @@ export class MonitorService extends CoreClientAware implements Disposable {
268268
this.updateClientsSettings({
269269
monitorUISettings: {
270270
connectionStatus: 'connected',
271-
connected: true,
271+
connected: true, // TODO: should be removed when plotter app understand the `connectionStatus` message
272272
serialPort: this.port.address,
273273
},
274274
});
@@ -311,7 +311,10 @@ export class MonitorService extends CoreClientAware implements Disposable {
311311
if (duplex === this.duplex) {
312312
this.duplex = null;
313313
this.updateClientsSettings({
314-
monitorUISettings: { connected: false },
314+
monitorUISettings: {
315+
connected: false, // TODO: should be removed when plotter app understand the `connectionStatus` message
316+
connectionStatus: 'not-connected',
317+
},
315318
});
316319
}
317320
this.logger.info(
@@ -322,7 +325,10 @@ export class MonitorService extends CoreClientAware implements Disposable {
322325
if (duplex === this.duplex) {
323326
this.duplex = null;
324327
this.updateClientsSettings({
325-
monitorUISettings: { connected: false },
328+
monitorUISettings: {
329+
connected: false, // TODO: should be removed when plotter app understand the `connectionStatus` message
330+
connectionStatus: 'not-connected',
331+
},
326332
});
327333
}
328334
this.logger.info(
@@ -545,7 +551,7 @@ export class MonitorService extends CoreClientAware implements Disposable {
545551
...settings.monitorUISettings,
546552
connectionStatus,
547553
serialPort: this.port.address,
548-
connected: isMonitorConnected(connectionStatus),
554+
connected: isMonitorConnected(connectionStatus), // TODO: should be removed when plotter app understand the `connectionStatus` message
549555
},
550556
pluggableMonitorSettings: reconciledSettings,
551557
});

0 commit comments

Comments
 (0)