fix song preview switching

This commit is contained in:
Kevin Ngo
2018-10-11 23:45:27 -07:00
parent 5eec114f1a
commit f9016a313e

View File

@@ -42,6 +42,8 @@ AFRAME.registerComponent('song-preview-system', {
// Selected challenge ID updated.
if (data.selectedChallengeId && oldData.selectedChallengeId !== data.selectedChallengeId) {
if (this.audio) { this.stopSong(); }
// If not yet preloaded, pause the preload queue until this song is loaded.
if (!this.preloadedAudioIds.includes(data.selectedChallengeId) &&
data.selectedChallengeId !== this.currentLoadingId) {