From 8fde559e8c663874ed2f88d6c60f1ce317bca442 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Tue, 18 Jan 2022 15:44:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=B7=B2=E6=94=B6=E8=97=8F?= =?UTF-8?q?=E7=9A=84=E5=9C=A8=E7=BA=BF=E5=88=97=E8=A1=A8=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=B0=86=E5=A7=8B=E7=BB=88=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E5=86=8D=E4=BD=BF=E7=94=A8=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 1 + src/screens/Home/List/components/MyList.js | 4 ++-- src/screens/Home/Top/BoardsList.js | 2 +- src/store/modules/songList/action.js | 3 ++- src/store/modules/top/action.js | 3 ++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index c0677f4..8cff26c 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -1,6 +1,7 @@ ### 优化 - 优化通知栏的更新机制,尝试修复魅族的通知栏图片不显示的问题 +- 我的列表-列表名的右击菜单更新已收藏的在线列表时,将始终重新加载,不再使用缓存,解决在原平台更新歌单后,在LX点击更新可能看到的还是在原平台更新前的歌单的问题 ### 修复 diff --git a/src/screens/Home/List/components/MyList.js b/src/screens/Home/List/components/MyList.js index 006157e..6c29cbd 100644 --- a/src/screens/Home/List/components/MyList.js +++ b/src/screens/Home/List/components/MyList.js @@ -224,9 +224,9 @@ const List = memo(({ setVisiblePanel, currentList, handleCancelMultiSelect }) => let promise if (/board__/.test(sourceListId)) { const id = sourceListId.replace(/board__/, '') - promise = getBoardListAll(id) + promise = getBoardListAll({ id, isRefresh: true }) } else { - promise = getListDetailAll({ source, id: sourceListId }) + promise = getListDetailAll({ source, id: sourceListId, isRefresh: true }) } return promise.finally(() => { setFetchingListStatus(fetchingListStatus => ({ ...fetchingListStatus, [id]: false })) diff --git a/src/screens/Home/Top/BoardsList.js b/src/screens/Home/Top/BoardsList.js index c14046e..057e7f0 100644 --- a/src/screens/Home/Top/BoardsList.js +++ b/src/screens/Home/Top/BoardsList.js @@ -51,7 +51,7 @@ const BoardMenu = ({ visible, buttonPosition, index, hideMenu }) => { hideMenu() if (action) { const board = boards[sourceId][index] - getListAll(board.id).then(list => { + getListAll({ id: board.id }).then(list => { if (!list.length) return switch (action) { diff --git a/src/store/modules/songList/action.js b/src/store/modules/songList/action.js index 09954c8..2f25aa2 100644 --- a/src/store/modules/songList/action.js +++ b/src/store/modules/songList/action.js @@ -138,8 +138,9 @@ export const getListDetail = ({ id, page, isRefresh = false }) => (dispatch, get }) } -export const getListDetailAll = ({ source, id }) => (dispatch, getState) => { +export const getListDetailAll = ({ source, id, isRefresh = false }) => (dispatch, getState) => { let listKey = `sdetail__${source}__${id}` + if (isRefresh && cache.has(listKey)) cache.delete(listKey) if (!cache.has(listKey)) cache.set(listKey, new Map()) const listCache = cache.get(listKey) const loadData = (id, page) => { diff --git a/src/store/modules/top/action.js b/src/store/modules/top/action.js index 176e23b..b70fac4 100644 --- a/src/store/modules/top/action.js +++ b/src/store/modules/top/action.js @@ -102,10 +102,11 @@ export const getList = ({ page, isRefresh = false }) => (dispatch, getState) => }) } -export const getListAll = tabId => (dispatch, getState) => { +export const getListAll = ({ id: tabId, isRefresh = false }) => (dispatch, getState) => { // console.log(tabId) const [source, bangId] = tabId.split('__') const listKey = `${source}__${tabId}` + if (isRefresh && cache.has(listKey)) cache.delete(listKey) if (!cache.has(listKey)) cache.set(listKey, new Map()) const listCache = cache.get(listKey) const loadData = (bangId, page) => {