fix: clear/rehydrate _executingNodeProgress on workflow tab switch

Addresses review feedback:
https://github.com/Comfy-Org/ComfyUI_frontend/pull/10689#discussion_r3007061637
This commit is contained in:
bymyself
2026-04-09 23:34:41 -07:00
parent de6eb5a7e7
commit 324ef4fab1

View File

@@ -633,6 +633,7 @@ export const useExecutionStore = defineStore('execution', () => {
watch(
() => workflowStore.activeWorkflow?.path,
(newPath) => {
_executingNodeProgress.value = null
if (!newPath) {
nodeProgressStates.value = {}
return
@@ -643,6 +644,17 @@ export const useExecutionStore = defineStore('execution', () => {
const [jobId, states] = jobEntries[i]
if (jobIdToSessionWorkflowPath.value.get(jobId) === newPath) {
nodeProgressStates.value = states
const firstRunning = Object.values(states).find(
(state) => state.state === 'running'
)
if (firstRunning) {
_executingNodeProgress.value = {
value: firstRunning.value,
max: firstRunning.max,
prompt_id: firstRunning.prompt_id,
node: firstRunning.display_node_id || firstRunning.node_id
}
}
return
}
}