mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-07-04 12:02:09 +08:00
移除多余代码
This commit is contained in:
parent
ee1cbfb25a
commit
a5c8e58a7c
@ -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) => {
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user