修复某些情况下列表同步不一致的问题
parent
4b5a7b6a74
commit
57a8b7842e
|
@ -96,16 +96,15 @@ const mutations = {
|
|||
allListInit(state.defaultList, state.loveList, state.userList)
|
||||
},
|
||||
setList(state, { id, list, name, location, source, sourceListId, isSync }) {
|
||||
if (!isSync) {
|
||||
window.eventHub.$emit(eventSyncName.send_action_list, {
|
||||
action: 'set_list',
|
||||
data: { id, list, name, location, source, sourceListId },
|
||||
})
|
||||
}
|
||||
|
||||
const targetList = allList[id]
|
||||
if (targetList) {
|
||||
if (name && targetList.name === name) {
|
||||
if (!isSync) {
|
||||
window.eventHub.$emit(eventSyncName.send_action_list, {
|
||||
action: 'set_list',
|
||||
data: { id, list, name, location, source, sourceListId },
|
||||
})
|
||||
}
|
||||
targetList.list.splice(0, targetList.list.length, ...list)
|
||||
targetList.location = location
|
||||
return
|
||||
|
@ -113,6 +112,12 @@ const mutations = {
|
|||
|
||||
id += '_' + Math.random()
|
||||
}
|
||||
if (!isSync) {
|
||||
window.eventHub.$emit(eventSyncName.send_action_list, {
|
||||
action: 'set_list',
|
||||
data: { id, list, name, location, source, sourceListId },
|
||||
})
|
||||
}
|
||||
let newList = {
|
||||
name,
|
||||
id,
|
||||
|
|
Loading…
Reference in New Issue