|
|
|
@ -33,7 +33,7 @@ interface AuioState {
|
|
|
|
|
setShow: (value: boolean) => void;
|
|
|
|
|
// 显示/隐藏单曲卡片
|
|
|
|
|
setShowCard: (value: boolean) => void;
|
|
|
|
|
setPlayListInfo: (info: IPlayListInfo) => void;
|
|
|
|
|
setPlayListInfo: (info: IPlayListInfo) => boolean;
|
|
|
|
|
// 设置播放列表
|
|
|
|
|
updatePlayList: (list: SongInfo[]) => void;
|
|
|
|
|
// 设置播放列表
|
|
|
|
@ -205,11 +205,17 @@ const useAudioState = create<AuioState>()(
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
setPlayListInfo: (list) => {
|
|
|
|
|
if (!checkAuthOffline()) {
|
|
|
|
|
openLogin();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set(
|
|
|
|
|
produce((state) => {
|
|
|
|
|
state.playListInfo = list;
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
return true;
|
|
|
|
|
},
|
|
|
|
|
updatePlayList: (list) => {
|
|
|
|
|
set(
|
|
|
|
@ -219,11 +225,6 @@ const useAudioState = create<AuioState>()(
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
setPlayList: (list) => {
|
|
|
|
|
if (!checkAuthOffline()) {
|
|
|
|
|
openLogin();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set(
|
|
|
|
|
produce((state) => {
|
|
|
|
|
state.playList = list;
|
|
|
|
@ -231,6 +232,7 @@ const useAudioState = create<AuioState>()(
|
|
|
|
|
state.playQueue = list;
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
return true;
|
|
|
|
|
},
|
|
|
|
|
setPlayQueue: (list) => {
|
|
|
|
|
set(
|
|
|
|
|