fix(Player): 收藏歌曲无id bug

feature/artists
mackt 7 months ago
parent 294849a111
commit a4f7873999

@ -234,7 +234,7 @@ export default function AudioPlayer({
<div className="flex items-end h-full">
<div className="flex h-full items-end h-fit mb-21px gap-18px">
{/* 收藏歌曲 */}
{<CollectButton id={audio.id || '0'} active={audio.haveCollect} collectType="0" color="dark" />}
{<CollectButton id={audio?.id ?? '0'} active={audio?.haveCollect ?? false} collectType="0" color="dark" />}
{/* 播放顺序 */}
<OrderButton
order={playOrder}

@ -245,7 +245,7 @@ const useAudioState = create<AuioState>()(
};
},
{
name: 'audioStore',
name: 'audio',
storage: createJSONStorage(() => localStorage),
},
),

Loading…
Cancel
Save