1
0
Fork 0

Fix Promise

This commit is contained in:
Starbeamrainbowlabs 2017-07-31 18:53:56 +01:00
parent f2af3336c1
commit 35b62d4506
1 changed files with 1 additions and 1 deletions

View File

@ -5,7 +5,7 @@ function SoundBox() {
if(typeof callback == "function")
this.sounds[sound_name].addEventListener("canplaythrough", callback);
else
return new Promise((resolve, reject) => this.sounds[sound_name].addEventListener("canplaythrough", resolve));
return new Promise((resolve, reject) => this.sounds[sound_name].addEventListener("canplaythrough", resolve), this.sounds[sound_name].addEventListener("error", reject));
};
this.remove = function(sound_name) {