修复下载列表播放歌曲序号更新问题

This commit is contained in:
lyswhut
2022-03-20 00:43:16 +08:00
parent 8b2be019c6
commit 8b988b227b
2 changed files with 8 additions and 1 deletions
@@ -1,6 +1,6 @@
import { onBeforeUnmount } from '@renderer/utils/vueTools'
import { player as eventPlayerNames, list as eventListNames } from '@renderer/event/names'
import { player as eventPlayerNames, list as eventListNames, download as eventDownloadNames } from '@renderer/event/names'
import { playInfo, playMusicInfo, updatePlayIndex } from '@renderer/core/share/player'
import { getList } from '@renderer/core/share/utils'
import { throttle } from '@renderer/utils'
@@ -30,9 +30,15 @@ export default ({ playNext }) => {
throttleListChange()
}
const handleDownloadListChange = () => {
handleListChange(['download'])
}
window.eventHub.on(eventListNames.listChange, handleListChange)
window.eventHub.on(eventDownloadNames.listChange, handleDownloadListChange)
onBeforeUnmount(() => {
window.eventHub.off(eventListNames.listChange, handleListChange)
window.eventHub.off(eventDownloadNames.listChange, handleDownloadListChange)
})
}