From 68b00710092ee2a081bad9063466354557c305c4 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Fri, 12 Jun 2026 14:19:59 +0800 Subject: [PATCH] refactor: remove unnecessary dashboard reveal state and simplify reveal logic --- src/pages/dashboard.vue | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/src/pages/dashboard.vue b/src/pages/dashboard.vue index f9330abc..531db959 100644 --- a/src/pages/dashboard.vue +++ b/src/pages/dashboard.vue @@ -66,9 +66,6 @@ const dashboardGrid = shallowRef(null) // 仪表板配置是否已完成首次加载,包含插件仪表板配置。 const isDashboardConfigLoaded = ref(false) -// 仪表板是否已完成首次整体渐现。 -const isDashboardRevealed = ref(false) - // 已完成组件模块加载的仪表板项目 ID。 const loadedDashboardGridItemIds = ref>(new Set()) @@ -267,7 +264,6 @@ function isDashboardGridReadyForReveal() { // 在配置、组件和 GridStack 都就绪后安排仪表板整体渐现。 function scheduleDashboardReveal() { if ( - isDashboardRevealed.value || isDashboardRevealPending || dashboardRevealFrame !== null || !isDashboardConfigLoaded.value || @@ -280,25 +276,18 @@ function scheduleDashboardReveal() { isDashboardRevealPending = true void nextTick(() => { isDashboardRevealPending = false - if ( - isDashboardRevealed.value || - !isDashboardConfigLoaded.value || - !isDashboardGridReadyForReveal() || - !areDashboardGridItemsLoaded() - ) { + if (!isDashboardConfigLoaded.value || !isDashboardGridReadyForReveal() || !areDashboardGridItemsLoaded()) { return } resizeAutoDashboardItemsToContent() if (typeof window === 'undefined') { - isDashboardRevealed.value = true return } dashboardRevealFrame = window.requestAnimationFrame(() => { dashboardRevealFrame = null - isDashboardRevealed.value = true notifyDashboardContentResize() }) }) @@ -1010,14 +999,8 @@ onBeforeUnmount(() => {