fix(tracks): old references to data
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
import { getPlayerState } from '$lib/player.svelte';
|
import { getPlayerState } from '$lib/player.svelte';
|
||||||
import { Button } from '$lib/components/ui/button';
|
import { Button } from '$lib/components/ui/button';
|
||||||
import { deserialize } from '$app/forms';
|
import { deserialize } from '$app/forms';
|
||||||
import type { Track, TrackList } from '$lib/proto/library';
|
import type { TrackList } from '$lib/proto/library';
|
||||||
dayjs.extend(duration);
|
dayjs.extend(duration);
|
||||||
|
|
||||||
const library = getLibraryState();
|
const library = getLibraryState();
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
const library = getLibraryState();
|
const library = getLibraryState();
|
||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
search.setTracks(data.tracks);
|
search.setTracks(library.tracks);
|
||||||
});
|
});
|
||||||
|
|
||||||
let contextMenuTarget = $state<string | null>(null);
|
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"
|
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}
|
use:enhance={submitPlayTrack}
|
||||||
>
|
>
|
||||||
{#each filteredTracks ?? data.tracks as track}
|
{#each filteredTracks ?? library.tracks as track}
|
||||||
<TrackListing
|
<TrackListing
|
||||||
{track}
|
{track}
|
||||||
currentlyPlaying={player.currentlyPlaying?.hash === track.hash}
|
|
||||||
oncontextmenu={(e, hash) => {
|
oncontextmenu={(e, hash) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
Reference in New Issue
Block a user