fix(tracks): old references to data
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user