Skip to content

Commit 9ec1fb4

Browse files
Removing touche events when unlocking only after promise returned from resume method gets resolved
1 parent 5f21646 commit 9ec1fb4

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

v3/src/sound/webaudio/WebAudioSoundManager.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ var WebAudioSoundManager = new Class({
6767
var _this = this;
6868
if (this.context.state === 'suspended') {
6969
var unlock_1 = function () {
70-
document.body.removeEventListener('touchstart', unlock_1);
71-
document.body.removeEventListener('touchend', unlock_1);
72-
_this.context.resume();
70+
_this.context.resume().then(function () {
71+
document.body.removeEventListener('touchstart', unlock_1);
72+
document.body.removeEventListener('touchend', unlock_1);
73+
});
7374
};
7475
document.body.addEventListener('touchstart', unlock_1, false);
7576
document.body.addEventListener('touchend', unlock_1, false);

0 commit comments

Comments
 (0)