[web] Fix display of player page when an item is added to an empty queue

This commit is contained in:
Alain Nussbaumer 2025-05-29 15:21:28 +02:00
parent 4531eaa75f
commit 0c7e94b903
4 changed files with 7 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@
<div
class="is-flex is-align-items-center has-text-centered px-5 is-full-height"
>
<div v-if="track.id" class="mx-auto" style="max-width: 32rem">
<div v-if="!queueStore.isEmpty" class="mx-auto" style="max-width: 32rem">
<div class="is-relative">
<control-image
:url="track.artwork_url"

View File

@ -11,8 +11,9 @@ export const useQueueStore = defineStore('QueueStore', {
},
getters: {
current(state) {
const player = usePlayerStore()
return state.items.find((item) => item.id === player.item_id) ?? {}
const playerStore = usePlayerStore()
playerStore.initialise()
return state.items.find((item) => item.id === playerStore.item_id) ?? {}
},
isEmpty(state) {
return state.count === 0