fix: 播放器内切换歌曲触发 setPlayInfo 导致无法下一首

feature/artists
mackt 7 months ago
parent c7e1db4d25
commit 698e83c992

@ -43,7 +43,7 @@ export default function ButtonFM() {
if (res.code === 200 && res.data.length > 0) {
const setRes = setPlayListInfo({
type: 'fm',
id: null,
id: 'fm',
});
if (!setRes) return;
setPlayList(res.data);

@ -9,6 +9,11 @@ import { SongCard } from '@/components';
import { useAudioStore } from '@/store';
interface Props {
/**
* vol:
* collectSingle:
* playerCard:
*/
listInfo: { type: 'vol' | 'collectSingle' | 'playerCard'; id: string | null };
songList: SongInfo[];
/** 收藏按钮的显示逻辑 always: 总是显示 playing: 播放时显示 */
@ -42,7 +47,7 @@ export default function SongCardList({ listInfo, songList, className, collectTyp
const isPlayingList = listInfo.type === playListInfo.type && listInfo.id === playListInfo.id; // 正在播放当前歌单
const isInQueue = playQueue.some((item) => item.id === id); // 所选的歌在队列中
if (isPlayingList && isInQueue) {
if ((isPlayingList && isInQueue) || listInfo.type === 'playerCard') {
setAudioId(id);
return;
}

Loading…
Cancel
Save