Resolve existing motor timeout (instead of reject)

This commit is contained in:
Tim Mickel 2016-05-09 14:18:33 -04:00
parent c37cf3fe85
commit 4d4682912d
3 changed files with 3 additions and 3 deletions

View file

@ -61,7 +61,7 @@ WeDo2Blocks.prototype._clamp = function(val, min, max) {
WeDo2Blocks.prototype._motorOnFor = function(direction, durationSeconds, util) { WeDo2Blocks.prototype._motorOnFor = function(direction, durationSeconds, util) {
if (this._motorTimeout > 0) { if (this._motorTimeout > 0) {
// @todo maybe this should go through util // @todo maybe this should go through util
YieldTimers.reject(this._motorTimeout); YieldTimers.resolve(this._motorTimeout);
this._motorTimeout = null; this._motorTimeout = null;
} }
if (window.native) { if (window.native) {

2
vm.js
View file

@ -2175,7 +2175,7 @@
WeDo2Blocks.prototype._motorOnFor = function(direction, durationSeconds, util) { WeDo2Blocks.prototype._motorOnFor = function(direction, durationSeconds, util) {
if (this._motorTimeout > 0) { if (this._motorTimeout > 0) {
// @todo maybe this should go through util // @todo maybe this should go through util
YieldTimers.reject(this._motorTimeout); YieldTimers.resolve(this._motorTimeout);
this._motorTimeout = null; this._motorTimeout = null;
} }
if (window.native) { if (window.native) {

2
vm.min.js vendored

File diff suppressed because one or more lines are too long