修复(播放器):标准化传递给点赞处理器的歌曲对象

确保传递给toggleLike的是一个具有标准化source属性的新对象引用。这解决了平台/source属性不匹配的潜在问题,并确保状态更新能够正确触发。
This commit is contained in:
史悦
2026-01-07 17:53:13 +08:00
parent 13ef60b7bd
commit 264ffb8b38

View File

@@ -641,7 +641,14 @@
name="heart" name="heart"
size="text-2xl" size="text-2xl"
className={`${isLiked ? "text-red-500" : "text-white/50 hover:text-white"} transition-colors`} className={`${isLiked ? "text-red-500" : "text-white/50 hover:text-white"} transition-colors`}
onClick={(e) => { e.stopPropagation(); toggleLike(currentSong); }} onClick={(e) => {
e.stopPropagation();
// Ensure we pass a clean object copy with normalized source to trigger updates correctly
toggleLike({
...currentSong,
source: currentSong.platform || currentSong.source
});
}}
/> />
</div> </div>
</div> </div>