mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-07-08 17:22:04 +08:00
refactor: standardize keep-alive data refreshing using useKeepAliveRefresh composable across views and dashboards
This commit is contained in:
@@ -362,9 +362,6 @@ const draggableFolderPlugins = ref<Plugin[]>([])
|
||||
// 是否正在拖拽排序中
|
||||
const isDraggingSortMode = ref(false)
|
||||
|
||||
// 插件市场分页 key,重置后让 VInfiniteScroll 重新触发首屏加载。
|
||||
const marketInfiniteKey = ref(0)
|
||||
|
||||
// 显示的文件夹列表(按排序显示)
|
||||
const displayedFolders = computed(() => {
|
||||
if (currentFolder.value) return [] // 在文件夹内不显示其他文件夹
|
||||
@@ -810,7 +807,6 @@ async function getPluginStatistics() {
|
||||
async function refreshData() {
|
||||
await fetchInstalledPlugins()
|
||||
await fetchUninstalledPlugins()
|
||||
marketInfiniteKey.value++
|
||||
getPluginStatistics()
|
||||
// 重新加载文件夹配置,确保分身插件能正确显示在文件夹中
|
||||
await loadPluginFolders()
|
||||
@@ -884,7 +880,6 @@ async function refreshMarket() {
|
||||
try {
|
||||
await fetchUninstalledPlugins(true)
|
||||
getPluginStatistics()
|
||||
marketInfiniteKey.value++
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
@@ -896,16 +891,10 @@ async function refreshActiveTabData() {
|
||||
if (sortMode.value || isDraggingSortMode.value) return
|
||||
|
||||
if (activeTab.value === 'market') {
|
||||
isAppMarketLoaded.value = false
|
||||
await fetchInstalledPlugins()
|
||||
await fetchUninstalledPlugins()
|
||||
getPluginStatistics()
|
||||
marketInfiniteKey.value++
|
||||
return
|
||||
}
|
||||
|
||||
await fetchInstalledPlugins()
|
||||
await fetchUninstalledPlugins()
|
||||
getPluginStatistics()
|
||||
// 文件夹配置可能在其它入口被插件操作改变,重新进入时同步一次。
|
||||
await loadPluginFolders()
|
||||
@@ -1716,7 +1705,6 @@ function onDragStartPlugin(evt: any) {
|
||||
mode="intersect"
|
||||
side="end"
|
||||
:items="displayUninstalledList"
|
||||
:key="marketInfiniteKey"
|
||||
@load="loadMarketMore"
|
||||
class="overflow-visible"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user