fix: the initial music sort error when restart app (#79)

master
njzy 4 years ago committed by GitHub
parent b394ec0899
commit 993f867109
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -43,10 +43,11 @@ Howler.volume(store.state.player.volume);
// 防止软件第一次打开资源加载2次 // 防止软件第一次打开资源加载2次
Howler.autoUnlock = false; Howler.autoUnlock = false;
const currentTrackId = store.state?.player?.currentTrack?.id; const currentTrack = store.state?.player?.currentTrack;
if (currentTrackId) { if (currentTrack?.id) {
store.dispatch("switchTrack", { store.dispatch("switchTrack", {
id: currentTrackId, id: currentTrack.id,
sort: currentTrack.sort,
autoplay: false, autoplay: false,
}); });
} }

Loading…
Cancel
Save