Skip to content

Commit 76bdaec

Browse files
jtydhr88github-actions[bot]
authored andcommitted
fix: should only trigger asset panel when it opening (#7098)
## Summary fix #7097 ## Screenshots <!-- Add screenshots or video recording to help explain your changes --> before <img width="2085" height="452" alt="image" src="https://github.com/user-attachments/assets/437f85f0-103f-422a-ba07-2e4e43f763d4" /> after <img width="1208" height="265" alt="image" src="https://github.com/user-attachments/assets/bcb246ee-d963-4c74-9e0b-8d02266cc6ac" /> ┆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)
1 parent f7278dd commit 76bdaec

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/views/GraphView.vue

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,19 +206,25 @@ const init = () => {
206206
}
207207
208208
const queuePendingTaskCountStore = useQueuePendingTaskCountStore()
209+
const sidebarTabStore = useSidebarTabStore()
210+
209211
const onStatus = async (e: CustomEvent<StatusWsMessageStatus>) => {
210212
queuePendingTaskCountStore.update(e)
211-
await Promise.all([
212-
queueStore.update(),
213-
assetsStore.updateHistory() // Update history assets when status changes
214-
])
213+
await queueStore.update()
214+
// Only update assets if the assets sidebar is currently open
215+
// When sidebar is closed, AssetsSidebarTab.vue will refresh on mount
216+
if (sidebarTabStore.activeSidebarTabId === 'assets') {
217+
await assetsStore.updateHistory()
218+
}
215219
}
216220
217221
const onExecutionSuccess = async () => {
218-
await Promise.all([
219-
queueStore.update(),
220-
assetsStore.updateHistory() // Update history assets on execution success
221-
])
222+
await queueStore.update()
223+
// Only update assets if the assets sidebar is currently open
224+
// When sidebar is closed, AssetsSidebarTab.vue will refresh on mount
225+
if (sidebarTabStore.activeSidebarTabId === 'assets') {
226+
await assetsStore.updateHistory()
227+
}
222228
}
223229
224230
const reconnectingMessage: ToastMessageOptions = {

0 commit comments

Comments
 (0)