From 2f2b1e2f924b5cb5c8fbed260af1fb134a4e8781 Mon Sep 17 00:00:00 2001 From: fspecii <4722521+fspecii@users.noreply.github.com> Date: Thu, 5 Feb 2026 22:59:41 +0200 Subject: [PATCH] Fix like button in right sidebar passing Song object instead of ID The onToggleLike handler expected a string songId but RightSidebar was passing the entire Song object, causing a FOREIGN KEY constraint error when SQLite received '[object Object]' as the song_id. Fixes #22 --- components/RightSidebar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/RightSidebar.tsx b/components/RightSidebar.tsx index 3969b61..ed93314 100644 --- a/components/RightSidebar.tsx +++ b/components/RightSidebar.tsx @@ -16,7 +16,7 @@ interface RightSidebarProps { onNavigateToProfile?: (username: string) => void; onNavigateToSong?: (songId: string) => void; isLiked?: boolean; - onToggleLike?: (song: Song) => void; + onToggleLike?: (songId: string) => void; onDelete?: (song: Song) => void; onAddToPlaylist?: (song: Song) => void; onPlay?: (song: Song) => void; @@ -335,7 +335,7 @@ export const RightSidebar: React.FC = ({ song, onClose, onOpe icon={} label={String(song.likeCount || 0)} active={isLiked} - onClick={() => onToggleLike?.(song)} + onClick={() => onToggleLike?.(song.id)} /> } onClick={() => setShareModalOpen(true)} />