diff --git a/src/renderer/store/modules/list.js b/src/renderer/store/modules/list.js index 30034f64..82f712c9 100644 --- a/src/renderer/store/modules/list.js +++ b/src/renderer/store/modules/list.js @@ -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,