Skip to content

Commit b582b39

Browse files
committed
add delay for windows serial disconnect
1 parent 02c8a15 commit b582b39

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"history": "^1.12.5",
1515
"iggins": "^0.4.0",
1616
"invariant": "^2.1.1",
17-
"irken": "^0.8.0",
17+
"irken": "^0.9.0",
1818
"lodash": "^3.9.1",
1919
"raw-loader": "^0.5.1",
2020
"react": "^0.13.1",

src/plugins/handlers.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,8 @@ function handlers(app, opts, done){
627627
/Bluetooth-Modem/,
628628
/dev\/cu\./
629629
],
630-
source: content
630+
source: content,
631+
delay: 300
631632
};
632633

633634
store.dispatch(creators.reloadDevices());
@@ -637,8 +638,10 @@ function handlers(app, opts, done){
637638
store.dispatch(creators.updateDevices(devices));
638639

639640
if(autoDownload){
640-
// TODO: how can I clean up this interaction?
641-
checkAutoDownload();
641+
// windows serial sometimes needs to wait after boards scanned.
642+
setTimeout(function() {
643+
checkAutoDownload();
644+
}, 100);
642645
}
643646
});
644647
}
@@ -681,7 +684,8 @@ function handlers(app, opts, done){
681684
/Bluetooth-Incoming-Port/,
682685
/Bluetooth-Modem/,
683686
/dev\/cu\./
684-
]
687+
],
688+
delay: 300
685689
};
686690

687691
app.scanBoards(scanOpts)

0 commit comments

Comments
 (0)