Skip to content

Commit af52ff5

Browse files
committed
Enable echo toggle while disconnected, set echo on connect
1 parent 4214f4c commit af52ff5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/plugins/handlers.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -486,13 +486,13 @@ function handlers(app, opts, done){
486486
const { device } = store.getState();
487487
const { echo } = consoleStore.getState();
488488
const { selected, connected } = device;
489+
if(echo){
490+
consoleStore.dispatch(creators.echoOff());
491+
}else{
492+
consoleStore.dispatch(creators.echoOn());
493+
}
489494
if(selected && connected){
490495
const board = app.getBoard(selected);
491-
if(echo){
492-
consoleStore.dispatch(creators.echoOff());
493-
}else{
494-
consoleStore.dispatch(creators.echoOn());
495-
}
496496
board.setEcho(!echo);
497497
}
498498
}
@@ -501,6 +501,7 @@ function handlers(app, opts, done){
501501
const { device } = store.getState();
502502
const { selected } = device;
503503
const { filename, content } = workspace.getState();
504+
const { echo } = consoleStore.getState();
504505

505506
if(!selected){
506507
return;
@@ -529,6 +530,7 @@ function handlers(app, opts, done){
529530
board.removeListener('progress', onProgress);
530531
resetDownloadProgress();
531532
connect();
533+
board.setEcho(echo);
532534
hideOverlay();
533535
});
534536
}

0 commit comments

Comments
 (0)