mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-11 10:39:56 -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);
|
const motor = this.motor(portID);
|
||||||
if (motor) {
|
if (motor) {
|
||||||
motor._status = feedback;
|
motor._status = feedback;
|
||||||
if (feedback === (BoostPortFeedback.COMPLETED ^ BoostPortFeedback.IDLE) &&
|
// Makes sure that commands resolve both when they actually complete and when they fail
|
||||||
motor.pendingPromiseFunction) {
|
const commandCompleted = feedback & (BoostPortFeedback.COMPLETED ^ BoostPortFeedback.DISCARDED);
|
||||||
|
if (commandCompleted && motor.pendingPromiseFunction) {
|
||||||
motor.pendingPromiseFunction();
|
motor.pendingPromiseFunction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue