Delete queue/history item

This commit is contained in:
space-nuko
2023-05-22 14:16:31 -05:00
parent a913a92096
commit 40c7eaa7ce
5 changed files with 136 additions and 15 deletions

View File

@@ -509,7 +509,35 @@ export default class ComfyApp {
this.api.init();
}
async interrupt() {
if (get(queueState).isInterrupting)
return
queueState.update(s => { s.isInterrupting = true; return s; })
await this.api.interrupt()
.finally(() => {
queueState.update(s => { s.isInterrupting = true; return s })
});
}
async deleteQueueItem(type: QueueItemType, promptID: PromptID) {
if (get(queueState).isInterrupting)
return
queueState.update(s => { s.isInterrupting = true; return s; })
await this.api.deleteItem(type, promptID)
.then(() => {
queueState.queueItemDeleted(type, promptID);
})
.finally(() => {
queueState.update(s => { s.isInterrupting = false; return s; })
});
}
async clearQueue(type: QueueItemType) {
if (get(queueState).isInterrupting)
return
queueState.update(s => { s.isInterrupting = true; return s; })
await this.api.clearItems(type)
.then(() => {