Fix undefined currentView variable in filteredTrackCount

Changed currentView to activeTab in the reactive counter logic. The variable
currentView doesn't exist - the correct variable is activeTab which tracks
the current selected tab (albums/artists/tracks).

This was causing LocalLibraryView to fail to mount/render.
This commit is contained in:
vicrodh committed 2026-01-20 01:49:11 -06:00
1 parent c66059d9c5
commit 8dcfeb7f70
1 file changed
+3 -3
@@ -186,15 +186,15 @@
let filteredArtistCount = $derived(artists.length); let filteredArtistCount = $derived(artists.length);
let filteredTrackCount = $derived.by(() => { let filteredTrackCount = $derived.by(() => {
// When in tracks view with search results, use actual filtered count // When in tracks view with search results, use actual filtered count
if (currentView === 'tracks' && tracks.length > 0) { if (activeTab === 'tracks' && tracks.length > 0) {
return tracks.length; return tracks.length;
} }
// When in albums view, calculate from filtered albums // When in albums view, calculate from filtered albums
if (currentView === 'albums' && albums.length > 0) { if (activeTab === 'albums' && albums.length > 0) {
return albums.reduce((sum, album) => sum + album.track_count, 0); return albums.reduce((sum, album) => sum + album.track_count, 0);
} }
// When in artists view, calculate from filtered artists // When in artists view, calculate from filtered artists
if (currentView === 'artists' && artists.length > 0) { if (activeTab === 'artists' && artists.length > 0) {
return artists.reduce((sum, artist) => sum + artist.track_count, 0); return artists.reduce((sum, artist) => sum + artist.track_count, 0);
} }
// Fallback to stats if available // Fallback to stats if available