From 57a8b7842e0009c50988f396121607b061f80f9c Mon Sep 17 00:00:00 2001 From: lyswhut Date: Thu, 19 Aug 2021 15:23:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=90=E4=BA=9B=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=E5=88=97=E8=A1=A8=E5=90=8C=E6=AD=A5=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/store/modules/list.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) 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,