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

This commit is contained in:
njzy 2020-12-09 19:51:35 +08:00 committed by GitHub
parent b394ec0899
commit 993f867109
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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