mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-10 18:10:08 +00:00
Fix delete queue item (#428)
This commit is contained in:
@@ -198,16 +198,20 @@ export const useQueueStore = defineStore('queue', {
|
||||
this.pendingTasks = toClassAll(queue.Pending)
|
||||
|
||||
// Process history items
|
||||
const newHistoryItems = history.History.filter(
|
||||
(item) => item.prompt[0] > this.lastHistoryQueueIndex
|
||||
const allIndex = new Set(
|
||||
history.History.map((item: TaskItem) => item.prompt[0])
|
||||
)
|
||||
|
||||
if (newHistoryItems.length > 0) {
|
||||
const newProcessedItems = toClassAll(newHistoryItems)
|
||||
this.historyTasks = [...newProcessedItems, ...this.historyTasks]
|
||||
.slice(0, this.maxHistoryItems)
|
||||
.sort((a, b) => b.queueIndex - a.queueIndex)
|
||||
}
|
||||
const newHistoryItems = toClassAll(
|
||||
history.History.filter(
|
||||
(item) => item.prompt[0] > this.lastHistoryQueueIndex
|
||||
)
|
||||
)
|
||||
const existingHistoryItems = this.historyTasks.filter(
|
||||
(item: TaskItemImpl) => allIndex.has(item.queueIndex)
|
||||
)
|
||||
this.historyTasks = [...newHistoryItems, ...existingHistoryItems]
|
||||
.slice(0, this.maxHistoryItems)
|
||||
.sort((a, b) => b.queueIndex - a.queueIndex)
|
||||
},
|
||||
async clear() {
|
||||
await Promise.all(
|
||||
|
||||
Reference in New Issue
Block a user