Skip to content

Commit 62f52c3

Browse files
committed
Cleanup and remove source, fix onClose binding
1 parent 51af4ad commit 62f52c3

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

client.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ function onRender(err){
9494
})
9595
.catch(console.error.bind(console));
9696

97-
chrome.usb.onDeviceAdded.addListener(function(device){
98-
deviceAdded(device);
99-
});
97+
chrome.usb.onDeviceAdded.addListener(deviceAdded);
10098
}
10199

102100
function onRegister(err){

src/plugins/handlers.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -615,17 +615,15 @@ function handlers(app, opts, done){
615615
download();
616616
}
617617

618-
function deviceAdded(device){
618+
function deviceAdded(){
619619
const { device } = store.getState();
620-
const { content } = workspace.getState();
621620

622621
const scanOpts = {
623622
reject: [
624623
/Bluetooth-Incoming-Port/,
625624
/Bluetooth-Modem/,
626625
/dev\/cu\./
627-
],
628-
source: content
626+
]
629627
};
630628

631629
app.scanBoards(scanOpts)
@@ -635,10 +633,12 @@ function handlers(app, opts, done){
635633
var board = app.getBoard(device.selected);
636634
if(board){
637635
board.removeListener('terminal', onTerminal);
636+
board.removeListener('close', onClose);
638637
board.open()
639638
.then(function(){
640639
connect();
641640
board.on('terminal', onTerminal);
641+
board.on('close', onClose);
642642
});
643643
}
644644
}

0 commit comments

Comments
 (0)