mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-07 16:40:05 +00:00
## Summary Fixes the cancel button on queue job items to properly handle pending (queued) jobs. ## Problem The cancel button was calling `api.interrupt()` for all jobs, but interrupt only affects running/initializing jobs. For pending jobs, it silently fails with log message: `"Prompt ... is not currently running, skipping interrupt"`. The "Cancel job" option in the context menu worked correctly because it checks the job state first. Reported in #7758. ## Changes Update `onCancelItem` in `QueueProgressOverlay.vue` to mirror the behavior of `cancelJob()` in `useJobMenu.ts`: - Check `item.state` before deciding which API to call - Call `api.interrupt(promptId)` for `running` or `initialization` states - Call `api.deleteItem('queue', promptId)` for `pending` state - Refresh queue state after cancel action with `queueStore.update()` ## Testing - All 3816 unit tests pass - Type check passes - Lint passes (prettier, oxlint, eslint) ## Steps to Reproduce (before fix) 1. Queue more than 1 job 2. Open job history 3. Click "Cancel" button on any "in queue" job 4. Observe nothing happens (job remains in queue) After this fix, clicking Cancel on a pending job will remove it from the queue. Fixes #7758 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7788-fix-queue-Cancel-button-now-works-for-pending-jobs-2d86d73d365081b3957fdf1d5d677809) by [Unito](https://www.unito.io) --------- Co-authored-by: RUiNtheExtinct <deepkarma001@gmail.com>