DEBUG: 用户加入离开避免影响音乐播放

This commit is contained in:
2023-10-24 08:21:15 +08:00
parent 018246e6dc
commit 2c748b029b
2 changed files with 1 additions and 267 deletions

View File

@@ -304,7 +304,7 @@ export default class MusicList {
}
async remove(item) {
this.ul.querySelector(`#${item.id}`)?.remove()
if (!this.audio.paused) this.stop() // 停止播放
if (!this.audio.paused && item.id === this.playing?.id) this.stop() // 停止播放
this.list = this.list.filter(i => i.id !== item.id)
this.event.onremove(item)
}