mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-26 01:09:46 +00:00
[bugfix] Clear queue button now properly removes initializing jobs from UI (#8203)
## Summary - Fix: Initializing jobs now properly disappear from UI when cancelled or cleared - Add `clearInitializationByPromptIds` batch function for optimized Set operations - Handle Cloud vs local environment correctly (use `api.deleteItem` for Cloud, `api.interrupt` for local) ## Problem When clicking 'Clear queue' button or X button on initializing jobs, the jobs remained visible in both AssetsSidebarListView and JobQueue components until page refresh. ## Root Cause 1. `initializingPromptIds` in `executionStore` was not being cleared when jobs were cancelled/deleted 2. Cloud environment requires `api.deleteItem()` instead of `api.interrupt()` for cancellation ## Changes - `src/stores/executionStore.ts`: Export `clearInitializationByPromptId` and add batch `clearInitializationByPromptIds` function - `src/composables/queue/useJobMenu.ts`: Add Cloud branch handling and initialization cleanup - `src/components/queue/QueueProgressOverlay.vue`: Fix `onCancelItem()`, `cancelQueuedWorkflows()`, `interruptAll()` - `src/components/sidebar/tabs/AssetsSidebarTab.vue`: Add initialization cleanup to `handleClearQueue()` [screen-capture.webm](https://github.com/user-attachments/assets/0bf911c2-d8f4-427c-96e0-4784e8fe0f08) 🤖 Generated with [Claude Code](https://claude.com/claude-code) ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8203-bugfix-Clear-queue-button-now-properly-removes-initializing-jobs-from-UI-2ef6d73d36508162a55bd84ad39ab49c) by [Unito](https://www.unito.io) --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -425,6 +425,18 @@ export const useExecutionStore = defineStore('execution', () => {
|
||||
initializingPromptIds.value = next
|
||||
}
|
||||
|
||||
function clearInitializationByPromptIds(promptIds: string[]) {
|
||||
if (!promptIds.length) return
|
||||
const current = initializingPromptIds.value
|
||||
const toRemove = promptIds.filter((id) => current.has(id))
|
||||
if (!toRemove.length) return
|
||||
const next = new Set(current)
|
||||
for (const id of toRemove) {
|
||||
next.delete(id)
|
||||
}
|
||||
initializingPromptIds.value = next
|
||||
}
|
||||
|
||||
function isPromptInitializing(
|
||||
promptId: string | number | undefined
|
||||
): boolean {
|
||||
@@ -650,6 +662,8 @@ export const useExecutionStore = defineStore('execution', () => {
|
||||
runningWorkflowCount,
|
||||
initializingPromptIds,
|
||||
isPromptInitializing,
|
||||
clearInitializationByPromptId,
|
||||
clearInitializationByPromptIds,
|
||||
bindExecutionEvents,
|
||||
unbindExecutionEvents,
|
||||
storePrompt,
|
||||
|
||||
Reference in New Issue
Block a user