From 4635481c77e53f92560f7b82b92d2f26e0b895b4 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Fri, 3 Feb 2023 19:41:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=97=E8=A1=A8=E5=93=8D?= =?UTF-8?q?=E5=BA=94=E5=BC=8F=E6=9B=B4=E6=96=B0=E6=9C=BA=E5=88=B6=EF=BC=8C?= =?UTF-8?q?=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D=E5=81=B6=E7=8E=B0=E7=9A=84?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=AD=8C=E6=9B=B2=E5=88=97=E8=A1=A8=E6=9C=AA?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 3 ++- src/renderer/views/Download/useListInfo.js | 2 +- .../views/List/MusicList/useListInfo.js | 17 +++++++++++++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index 6bad41df..4e8cc6b5 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -14,4 +14,5 @@ ### 修复 - 修复播放下载列表的歌曲时,调整歌词偏移时间功能异常的问题 -- 修复较旧Linux arm64系统下无法启动软件的问题(将预构建模块的编译器版本降级glibc到2.27)(#1161) +- 修复较旧Linux arm64系统下无法启动软件的问题(将预构建模块的所需glibc版本降级到2.27)(#1161) +- 修改列表响应式更新机制,尝试修复偶现的删除歌曲列表未更新的问题 diff --git a/src/renderer/views/Download/useListInfo.js b/src/renderer/views/Download/useListInfo.js index f69f8850..2a5dc2a7 100644 --- a/src/renderer/views/Download/useListInfo.js +++ b/src/renderer/views/Download/useListInfo.js @@ -25,7 +25,7 @@ export default (activeTab) => { case 'finished': return listAll.value.filter(i => i.status == downloadStatus.COMPLETED) default: - return listAll.value + return [...listAll.value] } }) diff --git a/src/renderer/views/List/MusicList/useListInfo.js b/src/renderer/views/List/MusicList/useListInfo.js index 1f2800ce..1d114978 100644 --- a/src/renderer/views/List/MusicList/useListInfo.js +++ b/src/renderer/views/List/MusicList/useListInfo.js @@ -1,4 +1,4 @@ -import { ref, watch, computed } from '@common/utils/vueTools' +import { ref, watch, computed, onBeforeUnmount } from '@common/utils/vueTools' import { playMusicInfo, playInfo } from '@renderer/store/player/state' import { getListMusics } from '@renderer/store/list/action' import { appSetting } from '@renderer/store/setting' @@ -16,7 +16,7 @@ export default ({ props, onLoadedList }) => { const list = ref([]) watch(() => props.listId, id => { getListMusics(id).then(l => { - list.value = l + list.value = [...l] if (id != props.listId) return onLoadedList() }) @@ -35,6 +35,19 @@ export default ({ props, onLoadedList }) => { const isShowSource = computed(() => appSetting['list.isShowSource']) + const handleMyListUpdate = (ids) => { + if (!ids.includes(props.listId)) return + getListMusics(props.listId).then(l => { + list.value = [...l] + }) + } + + window.app_event.on('myListUpdate', handleMyListUpdate) + + onBeforeUnmount(() => { + window.app_event.off('myListUpdate', handleMyListUpdate) + }) + return { rightClickSelectedIndex, selectedIndex,