diff --git a/front/src/composables/audio/useSound.ts b/front/src/composables/audio/useSound.ts index d9f824f0c..7648b733a 100644 --- a/front/src/composables/audio/useSound.ts +++ b/front/src/composables/audio/useSound.ts @@ -46,7 +46,12 @@ const createSound = (howl: Howl): Sound => ({ seek: (time?: number) => howl.seek(time), duration: () => howl.duration(), getSource: () => (howl as any)._sounds[0], - triggerSoundProgress: useThrottleFn((time: number, duration: number) => soundProgress.trigger({ node: (howl as any)._sounds[0]._node, time, duration }), 1000) + triggerSoundProgress: useThrottleFn((time: number, duration: number) => { + const node = (howl as any)._sounds[0]?._node + if (node) { + soundProgress.trigger({ node, time, duration }) + } + }, 1000) }) const loadSound = (track: Track): Sound => { diff --git a/front/src/store/queue.ts b/front/src/store/queue.ts index eec5b0787..06e1c83ff 100644 --- a/front/src/store/queue.ts +++ b/front/src/store/queue.ts @@ -87,6 +87,7 @@ const store: Module = { const shouldPlay = state.tracks.length === 0 if (shouldPlay) { index = 0 + state.currentIndex = 0 } if (index >= state.tracks.length) {