Resume playback when changing song from queue

This commit is contained in:
wvffle 2022-07-21 23:28:54 +00:00 committed by Georg Krause
parent 4c02478470
commit 232f0ff465
1 changed files with 7 additions and 2 deletions

View File

@ -111,6 +111,11 @@ const touchProgress = (event: MouseEvent) => {
const time = ((event.clientX - (event.target as Element).getBoundingClientRect().left) / progressBar.value.offsetWidth) * duration.value
currentTime.value = time
}
const play = (index: number) => {
store.dispatch('queue/currentIndex', index)
resume()
}
</script>
<template>
@ -368,7 +373,7 @@ const touchProgress = (event: MouseEvent) => {
</td>
<td
class="image-cell"
@click="$store.dispatch('queue/currentIndex', index)"
@click="play(index)"
>
<img
v-if="track.cover && track.cover.urls.original"
@ -391,7 +396,7 @@ const touchProgress = (event: MouseEvent) => {
</td>
<td
colspan="3"
@click="$store.dispatch('queue/currentIndex', index)"
@click="play(index)"
>
<button
class="title reset ellipsis"