fix(tracks): old references to data

This commit is contained in:
2024-12-03 00:24:17 +01:00
parent 793359b06e
commit b0d8c52640
2 changed files with 3 additions and 4 deletions

View File

@@ -10,7 +10,7 @@
import { getPlayerState } from '$lib/player.svelte';
import { Button } from '$lib/components/ui/button';
import { deserialize } from '$app/forms';
import type { Track, TrackList } from '$lib/proto/library';
import type { TrackList } from '$lib/proto/library';
dayjs.extend(duration);
const library = getLibraryState();

View File

@@ -25,7 +25,7 @@
const library = getLibraryState();
$effect(() => {
search.setTracks(data.tracks);
search.setTracks(library.tracks);
});
let contextMenuTarget = $state<string | null>(null);
@@ -105,10 +105,9 @@
class="grid grid-cols-2 gap-4 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-7 2xl:grid-cols-8"
use:enhance={submitPlayTrack}
>
{#each filteredTracks ?? data.tracks as track}
{#each filteredTracks ?? library.tracks as track}
<TrackListing
{track}
currentlyPlaying={player.currentlyPlaying?.hash === track.hash}
oncontextmenu={(e, hash) => {
e.stopPropagation();
e.preventDefault();