[web] Add helper method in stores

This commit is contained in:
Alain Nussbaumer 2025-05-24 10:18:59 +02:00
parent 04c119a3fd
commit 78ffba97d8
2 changed files with 2 additions and 1 deletions

View File

@ -16,6 +16,7 @@ export const usePlayerStore = defineStore('PlayerStore', {
}
},
getters: {
isMuted: (state) => state.volume === 0,
isPlaying: (state) => state.state === 'play',
isRepeatAll: (state) => state.repeat === 'all',
isRepeatOff: (state) => state.repeat === 'off',

View File

@ -15,7 +15,7 @@ export const useQueueStore = defineStore('QueueStore', {
return state.items.find((item) => item.id === player.item_id) ?? {}
},
isEmpty(state) {
return state.items.length === 0
return state.count === 0
},
isPauseAllowed(state) {
return state.current && state.current.data_kind !== 'pipe'