Skip to content

Commit 51af4ad

Browse files
committed
Re-enable terminal on reconnect
1 parent d96c714 commit 51af4ad

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

client.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,8 @@ function onRender(err){
9595
.catch(console.error.bind(console));
9696

9797
chrome.usb.onDeviceAdded.addListener(function(device){
98-
console.log('device added: ', device);
9998
deviceAdded(device);
10099
});
101-
102-
chrome.usb.onDeviceRemoved.addListener(function(device){
103-
console.log('device removed: ', device);
104-
});
105100
}
106101

107102
function onRegister(err){

src/plugins/handlers.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,9 +634,12 @@ function handlers(app, opts, done){
634634
if(device.selected && device.path && !device.connected && _.some(devices, 'path', device.selected.path)){
635635
var board = app.getBoard(device.selected);
636636
if(board){
637-
console.log('opening', board);
638-
board.open();
639-
connect();
637+
board.removeListener('terminal', onTerminal);
638+
board.open()
639+
.then(function(){
640+
connect();
641+
board.on('terminal', onTerminal);
642+
});
640643
}
641644
}
642645
});

0 commit comments

Comments
 (0)