diff --git a/src/lib/components/AlbumCard.svelte b/src/lib/components/AlbumCard.svelte index ff2858a57..068ff4ee8 100644 --- a/src/lib/components/AlbumCard.svelte +++ b/src/lib/components/AlbumCard.svelte @@ -5,6 +5,7 @@ import { subscribe as subscribeAlbumFavorites, isAlbumFavorite, + isAlbumToggling, loadAlbumFavorites, toggleAlbumFavorite } from '$lib/stores/albumFavoritesStore'; @@ -86,6 +87,7 @@ const artistDuration = $derived(artistOverflow > 0 ? `${(artistOverflow + 16) / tickerSpeed}s` : '0s'); let favoriteFromStore = $state(false); + let isToggling = $state(false); const isFavorite = $derived(albumId ? favoriteFromStore : false); const hasMenu = $derived(!!(onPlayNext || onPlayLater || onShareQobuz || onShareSonglink || onDownload)); const showFavoriteButton = $derived(showFavorite ?? !!albumId); @@ -158,8 +160,10 @@ if (albumId) { void loadAlbumFavorites(); favoriteFromStore = isAlbumFavorite(albumId); + isToggling = isAlbumToggling(albumId); const unsubscribe = subscribeAlbumFavorites(() => { favoriteFromStore = isAlbumFavorite(albumId); + isToggling = isAlbumToggling(albumId); }); return () => unsubscribe(); } @@ -217,10 +221,11 @@