mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Merge pull request #2099 from knandersen/bugfix/2085
Fix #2085 by handling discarded hub commands
This commit is contained in:
commit
03b4d0e582
1 changed files with 3 additions and 2 deletions
|
@ -943,8 +943,9 @@ class Boost {
|
|||
const motor = this.motor(portID);
|
||||
if (motor) {
|
||||
motor._status = feedback;
|
||||
if (feedback === (BoostPortFeedback.COMPLETED ^ BoostPortFeedback.IDLE) &&
|
||||
motor.pendingPromiseFunction) {
|
||||
// Makes sure that commands resolve both when they actually complete and when they fail
|
||||
const commandCompleted = feedback & (BoostPortFeedback.COMPLETED ^ BoostPortFeedback.DISCARDED);
|
||||
if (commandCompleted && motor.pendingPromiseFunction) {
|
||||
motor.pendingPromiseFunction();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue