Platine etape 1

This commit is contained in:
valere
2025-12-07 19:44:21 +01:00
parent 9f70419ea5
commit 6176995032
15 changed files with 771 additions and 27 deletions

View File

@@ -23,6 +23,11 @@ export const useCardStore = defineStore('card', {
this.saveToLocalStorage()
},
hideCard(trackId: number) {
this.revealedCards.delete(trackId)
this.saveToLocalStorage()
},
// Vérifier si une carte est révélée
isCardRevealed(trackId: number): boolean {
return this.revealedCards.has(trackId)
@@ -50,6 +55,13 @@ export const useCardStore = defineStore('card', {
this.saveToLocalStorage()
},
hideAllCards(tracks: Track[]) {
tracks.forEach((track) => {
this.hideCard(track.id)
})
this.saveToLocalStorage()
},
// Sauvegarder l'état dans le localStorage
saveToLocalStorage() {
if (typeof window !== 'undefined') {

View File

@@ -22,7 +22,10 @@ export const useDataStore = defineStore('data', {
// Mapper les tracks pour remplacer l'artist avec un objet Artist cohérent
const artistMap = new Map(this.artists.map((a) => [a.id, a]))
const allTracks = [...(compilationTracks ?? []), ...(playlistTracks ?? [])]
const allTracks = [
...(Array.isArray(compilationTracks) ? compilationTracks : []),
...(Array.isArray(playlistTracks) ? playlistTracks : [])
]
this.tracks = allTracks.map((track) => {
const a = track.artist as unknown

View File

@@ -46,8 +46,6 @@ export const useUiStore = defineStore('ui', {
dataStore.boxes.forEach((box) => {
box.state = 'box-list'
})
// Scroll back to the unselected box in the list
if (selectedBox) this.scrollToBox(selectedBox)
},
scrollToBox(box: Box) {