Stop hide timeouts from sticking around through green flag/stop.

This commit is contained in:
Paul Kaplan 2017-10-23 11:19:39 -04:00
parent 44ca62fefc
commit 87a0224790

View file

@ -93,6 +93,7 @@ class Scratch3LooksBlocks {
bubbleState.skinId = null; bubbleState.skinId = null;
} }
target.removeListener(RenderedTarget.EVENT_TARGET_MOVED, this._onTargetMoved); target.removeListener(RenderedTarget.EVENT_TARGET_MOVED, this._onTargetMoved);
clearTimeout(this._bubbleTimeout);
} }
/** /**
@ -254,7 +255,8 @@ class Scratch3LooksBlocks {
sayforsecs (args, util) { sayforsecs (args, util) {
this.say(args, util); this.say(args, util);
return new Promise(resolve => { return new Promise(resolve => {
setTimeout(() => { this._bubbleTimeout = setTimeout(() => {
this._bubbleTimeout = null;
// Clear say bubble and proceed. // Clear say bubble and proceed.
this._updateBubble(util.target, 'say', ''); this._updateBubble(util.target, 'say', '');
resolve(); resolve();
@ -269,7 +271,8 @@ class Scratch3LooksBlocks {
thinkforsecs (args, util) { thinkforsecs (args, util) {
this.think(args, util); this.think(args, util);
return new Promise(resolve => { return new Promise(resolve => {
setTimeout(() => { this._bubbleTimeout = setTimeout(() => {
this._bubbleTimeout = null;
// Clear say bubble and proceed. // Clear say bubble and proceed.
this._updateBubble(util.target, 'think', ''); this._updateBubble(util.target, 'think', '');
resolve(); resolve();