From 573cda853b49f9272134589391d75f1316a1cb09 Mon Sep 17 00:00:00 2001 From: Terry Jia Date: Tue, 2 Dec 2025 13:44:53 -0500 Subject: [PATCH] fix: should only trigger asset panel when it opening (#7098) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary fix https://github.com/Comfy-Org/ComfyUI_frontend/issues/7097 ## Screenshots before image after image ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7098-fix-should-only-trigger-asset-panel-when-it-opening-2bd6d73d36508118a8a6e7db994da775) by [Unito](https://www.unito.io) --- src/views/GraphView.vue | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/views/GraphView.vue b/src/views/GraphView.vue index 5603984218..03fdb7ca2c 100644 --- a/src/views/GraphView.vue +++ b/src/views/GraphView.vue @@ -206,19 +206,25 @@ const init = () => { } const queuePendingTaskCountStore = useQueuePendingTaskCountStore() +const sidebarTabStore = useSidebarTabStore() + const onStatus = async (e: CustomEvent) => { queuePendingTaskCountStore.update(e) - await Promise.all([ - queueStore.update(), - assetsStore.updateHistory() // Update history assets when status changes - ]) + await queueStore.update() + // Only update assets if the assets sidebar is currently open + // When sidebar is closed, AssetsSidebarTab.vue will refresh on mount + if (sidebarTabStore.activeSidebarTabId === 'assets') { + await assetsStore.updateHistory() + } } const onExecutionSuccess = async () => { - await Promise.all([ - queueStore.update(), - assetsStore.updateHistory() // Update history assets on execution success - ]) + await queueStore.update() + // Only update assets if the assets sidebar is currently open + // When sidebar is closed, AssetsSidebarTab.vue will refresh on mount + if (sidebarTabStore.activeSidebarTabId === 'assets') { + await assetsStore.updateHistory() + } } const reconnectingMessage: ToastMessageOptions = {