Skip to content

Commit a4ac01a

Browse files
author
Akos Kitta
committed
fix: backward compatibility with the plotter app
Signed-off-by: Akos Kitta <[email protected]>
1 parent 6ca11d8 commit a4ac01a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

+11
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,17 @@ export class MonitorService extends CoreClientAware implements Disposable {
739739
settings.monitorUISettings.connectionStatus
740740
);
741741
}
742+
if (
743+
typeof settings.monitorUISettings?.connected === 'boolean' &&
744+
!('connectionStatus' in settings.monitorUISettings)
745+
) {
746+
// Set the connectionStatus if the message was sent by the plotter which does not handle the new protocol. Assuming that the plotter can send anything.
747+
// https://github.com/arduino/arduino-serial-plotter-webapp#monitor-settings
748+
settings.monitorUISettings.connectionStatus = settings.monitorUISettings
749+
.connected
750+
? 'connected'
751+
: 'not-connected';
752+
}
742753
const command: Monitor.Message = {
743754
command: Monitor.MiddlewareCommand.ON_SETTINGS_DID_CHANGE,
744755
data: settings,

0 commit comments

Comments
 (0)