Skip to content

Commit

Permalink
fix: fix song loop not working
Browse files Browse the repository at this point in the history
  • Loading branch information
Clarkkkk committed Jun 22, 2024
1 parent a31603e commit 3db0c05
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/stores/usePlaylistStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const usePlaylistStore = defineStore('playlist', () => {
const playMode = ref<'list-loop' | 'list-sequent' | 'song-loop' | 'radio' | 'radio-song-loop'>(
'list-sequent'
)
const { updateAudioStatus } = useAudioStore()
const { updateAudioStatus, setLoop } = useAudioStore()
const { audioStatus } = storeToRefs(useAudioStore())

const nextSong = computed(() => {
Expand Down Expand Up @@ -71,6 +71,12 @@ export const usePlaylistStore = defineStore('playlist', () => {

function updatePlayMode(mode: typeof playMode.value) {
playMode.value = mode

if (mode === 'song-loop' || mode === 'radio-song-loop') {
setLoop(true)
} else {
setLoop(false)
}
}

function updateCurrentSongStatus(status: Song['status']) {
Expand Down

0 comments on commit 3db0c05

Please sign in to comment.