修复列表操作问题

pull/733/head
lyswhut 2021-12-04 01:55:36 +08:00
parent f732ea4dab
commit 8949383ade
1 changed files with 6 additions and 3 deletions

View File

@ -345,9 +345,10 @@ const mutations = {
}) })
} }
let list = allList[id] let list = userLists[id]
if (!list) return if (!list) return
list.name = name list.name = name
window.eventHub.emit(eventListNames.listChange, [id])
}, },
moveupUserList(state, { id, isSync }) { moveupUserList(state, { id, isSync }) {
if (!isSync) { if (!isSync) {
@ -359,9 +360,10 @@ const mutations = {
const index = userLists.findIndex(l => l.id == id) const index = userLists.findIndex(l => l.id == id)
if (index < 0) return if (index < 0) return
let targetList = allList[id] let targetList = userLists[id]
userLists.splice(index, 1) userLists.splice(index, 1)
userLists.splice(index - 1, 0, targetList) userLists.splice(index - 1, 0, targetList)
window.eventHub.emit(eventListNames.listChange, [id])
}, },
movedownUserList(state, { id, isSync }) { movedownUserList(state, { id, isSync }) {
if (!isSync) { if (!isSync) {
@ -372,9 +374,10 @@ const mutations = {
} }
const index = userLists.findIndex(l => l.id == id) const index = userLists.findIndex(l => l.id == id)
if (index < 0) return if (index < 0) return
let targetList = allList[id] let targetList = userLists[id]
userLists.splice(index, 1) userLists.splice(index, 1)
userLists.splice(index + 1, 0, targetList) userLists.splice(index + 1, 0, targetList)
window.eventHub.emit(eventListNames.listChange, [id])
}, },
setMusicPosition(state, { id, position, list, isSync }) { setMusicPosition(state, { id, position, list, isSync }) {
if (!isSync) { if (!isSync) {