修复(播放器):标准化传递给点赞处理器的歌曲对象
确保传递给toggleLike的是一个具有标准化source属性的新对象引用。这解决了平台/source属性不匹配的潜在问题,并确保状态更新能够正确触发。
This commit is contained in:
@@ -641,7 +641,14 @@
|
||||
name="heart"
|
||||
size="text-2xl"
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user