We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 20f3c6a commit debfc36Copy full SHA for debfc36
src/js/msp.js
@@ -461,9 +461,6 @@ const MSP = {
461
return;
462
}
463
464
- // Clear the existing timer before retry
465
- clearTimeout(requestObj.timer);
466
-
467
serial.send(bufferOut, (sendInfo) => {
468
if (sendInfo.bytesSent === bufferOut.byteLength) {
469
requestObj.timer = setTimeout(() => {
@@ -480,6 +477,11 @@ const MSP = {
480
477
},
481
478
482
479
_removeRequestFromCallbacks(requestObj) {
+ // Clear the timer if it exists
+ if (requestObj.timer) {
+ clearTimeout(requestObj.timer);
483
+ }
484
+
485
const index = this.callbacks.indexOf(requestObj);
486
if (index > -1) {
487
this.callbacks.splice(index, 1);
0 commit comments