fix(playlist): clear old tracks immediately on playlist switch to prevent stale recomputation

This commit is contained in:
vicrodh committed 2026-02-09 20:51:04 -06:00
1 parent 542eb9b9b5
commit 0717e1c478
1 file changed
+5
@@ -446,6 +446,11 @@
$effect(() => {
// Access playlistId to create dependency
const id = playlistId;
// FIRST: clear old data so no $derived recomputes against stale 800+ item arrays
tracks = [];
localTracks = [];
localTracksMap = new Map();
playlist = null;
// Reset suggestions state for new playlist
suggestionsActivated = false;
// Reset virtual scroll state so new playlist renders from the top