From a5c8e58a7c680068f3758a6e80ef2038c362c75e Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sat, 30 Oct 2021 10:09:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=A4=9A=E4=BD=99=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/list/action.js | 8 ++++---- src/store/modules/list/reducer.js | 11 ++++------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/store/modules/list/action.js b/src/store/modules/list/action.js index 1ce787a..148fc03 100644 --- a/src/store/modules/list/action.js +++ b/src/store/modules/list/action.js @@ -121,11 +121,11 @@ export const setSyncList = ({ defaultList, loveList, userList }) => async(dispat saveList([defaultList, loveList, ...userList]) } -export const setList = ({ id, list, name, location, source, sourceListId, isSync }) => async(dispatch, getState) => { +export const setList = ({ id, list, name, source, sourceListId, isSync }) => async(dispatch, getState) => { const targetList = global.allList[id] if (targetList) { if (name && targetList.name === name) { - if (!isSync) listSync.sendListAction('set_list', { id, list, name, location, source, sourceListId }) + if (!isSync) listSync.sendListAction('set_list', { id, list, name, source, sourceListId }) dispatch({ type: TYPES.listClear, payload: id, @@ -136,9 +136,9 @@ export const setList = ({ id, list, name, location, source, sourceListId, isSync id += '_' + Math.random() } - if (!isSync) listSync.sendListAction('set_list', { id, list, name, location, source, sourceListId }) + if (!isSync) listSync.sendListAction('set_list', { id, list, name, source, sourceListId }) - await dispatch(createUserList({ id, list, name, location, source, sourceListId, isSync: true })) + await dispatch(createUserList({ id, list, name, source, sourceListId, isSync: true })) } export const listAdd = ({ musicInfo, id, addMusicLocationType, isSync }) => (dispatch, getState) => { diff --git a/src/store/modules/list/reducer.js b/src/store/modules/list/reducer.js index 15f7b48..53c7b91 100644 --- a/src/store/modules/list/reducer.js +++ b/src/store/modules/list/reducer.js @@ -24,19 +24,16 @@ const initialState = { id: 'default', name: '试听列表', list: [], - location: 0, }, loveList: { id: 'love', name: '我的收藏', list: [], - location: 0, }, tempList: { id: 'temp', name: '临时列表', list: [], - location: 0, }, userList: [], listPosition: {}, @@ -73,11 +70,11 @@ const mutations = { const newState = { ...state } const ids = [] if (defaultList != null) { - newState.defaultList = { ...state.defaultList, list: defaultList.list, location: defaultList.location } + newState.defaultList = { ...state.defaultList, list: defaultList.list } ids.push(defaultList.id) } if (loveList != null) { - newState.loveList = { ...state.loveList, list: loveList.list, location: loveList.location } + newState.loveList = { ...state.loveList, list: loveList.list } ids.push(loveList.id) } if (userList != null) { @@ -102,8 +99,8 @@ const mutations = { }, /* [TYPES.initList](state, { defaultList, loveList, userList }) { const newState = { ...state } - if (defaultList != null) newState.defaultList = { ...state.defaultList, list: defaultList.list, location: defaultList.location } - if (loveList != null) newState.loveList = { ...state.loveList, list: loveList.list, location: loveList.location } + if (defaultList != null) newState.defaultList = { ...state.defaultList, list: defaultList.list } + if (loveList != null) newState.loveList = { ...state.loveList, list: loveList.list } if (userList != null) newState.userList = userList allListInit(state.defaultList, state.loveList, state.userList) state.isInitedList = true