Drive the theme accent from the app layout instead of the player

This commit is contained in:
2026-09-24 13:59:54 +02:00
parent 351b333529
commit 0a192645d6
2 changed files with 7 additions and 3 deletions
@@ -12,6 +12,8 @@
import { queuePanel } from '$lib/state/panels.svelte';
import { liked } from '$lib/state/liked.svelte';
import { createPlaylistModal } from '$lib/state/panels.svelte';
import { accent } from '$lib/theme/accent.svelte';
import { trackCover } from '$lib/utils/hrefs';
import { trackNavigation } from '$lib/state/history.svelte';
import { restoreScroll } from '$lib/state/scroll';
import { page } from '$app/state';
@@ -36,6 +38,11 @@
if (data.lastPlayedTrack) player.hydrate(data.lastPlayedTrack);
});
$effect(() => {
const id = player.currentId;
if (id) accent.follow(trackCover(id, 'small'), () => player.currentId === id);
});
let queueAutoOpened = false;
$effect(() => {
if (!player.playing || queueAutoOpened) return;