mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Resolves #2085
This was caused because the case for BoostMessage.PORT_FEEDBACK didn't handle the BoostPortFeedback.DISCARDED type, which corresponds to a command failing on the Boost hub.
This commit is contained in:
parent
f02433510a
commit
2ee8042b6a
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