Fix calling createTrack multiple times when radio track changes

This commit is contained in:
wvffle 2022-10-28 10:02:12 +00:00 committed by Georg Krause
commit f06464ffa2
No known key found for this signature in database
GPG key ID: 2970D504B2183D22
7 changed files with 35 additions and 18 deletions

View file

@ -235,6 +235,12 @@ export const useQueue = createGlobalState(() => {
return date
}))
// Clear
const clear = () => {
store.commit('radios/reset')
tracks.value.length = 0
}
// Radio queue populating
watchEffect(() => {
if (store.state.radios.running && currentIndex.value === tracks.value.length - 1) {
@ -260,6 +266,7 @@ export const useQueue = createGlobalState(() => {
shuffle,
reshuffleUpcomingTracks,
reorder,
endsIn
endsIn,
clear
}
})