debug(favorites): add logging to track favorite toggle issue

Also adds type="button" to favorite button for consistency with other buttons.
This commit is contained in:
vicrodh committed 2026-01-27 19:44:59 -06:00
1 parent a483c766ab
commit efb305fe09
1 file changed
+7 -1
+7 -1
View File
@@ -103,8 +103,13 @@
// Handle favorite toggle internally
async function handleToggleFavorite(e: MouseEvent) {
e.stopPropagation();
console.log('[TrackRow] handleToggleFavorite called, trackId:', trackId);
if (trackId !== undefined) {
await toggleTrackFavorite(trackId);
console.log('[TrackRow] Calling toggleTrackFavorite for track:', trackId);
const result = await toggleTrackFavorite(trackId);
console.log('[TrackRow] toggleTrackFavorite result:', result);
} else {
console.warn('[TrackRow] trackId is undefined, cannot toggle favorite');
}
}
@@ -205,6 +210,7 @@
<div class="favorite-placeholder"></div>
{:else if !hideFavorite}
<button
type="button"
class="favorite-btn"
class:is-favorite={isFavorite}
onclick={handleToggleFavorite}