mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
Move queueStore update to GraphView (#1679)
This commit is contained in:
@@ -284,11 +284,6 @@ const confirmRemoveAll = (event: Event) => {
|
||||
})
|
||||
}
|
||||
|
||||
const onStatus = async () => {
|
||||
await queueStore.update()
|
||||
updateVisibleTasks()
|
||||
}
|
||||
|
||||
const menu = ref(null)
|
||||
const menuTargetTask = ref<TaskItemImpl | null>(null)
|
||||
const menuTargetNode = ref<ComfyNode | null>(null)
|
||||
@@ -351,12 +346,11 @@ const toggleImageFit = () => {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
api.addEventListener('status', onStatus)
|
||||
queueStore.update()
|
||||
api.addEventListener('status', updateVisibleTasks)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
api.removeEventListener('status', onStatus)
|
||||
api.removeEventListener('status', updateVisibleTasks)
|
||||
})
|
||||
|
||||
// Watch for changes in allTasks and reset visibleTasks if necessary
|
||||
|
||||
@@ -19,7 +19,10 @@ import { useI18n } from 'vue-i18n'
|
||||
import { useWorkspaceStore } from '@/stores/workspaceStore'
|
||||
import { api } from '@/scripts/api'
|
||||
import { StatusWsMessageStatus } from '@/types/apiTypes'
|
||||
import { useQueuePendingTaskCountStore } from '@/stores/queueStore'
|
||||
import {
|
||||
useQueuePendingTaskCountStore,
|
||||
useQueueStore
|
||||
} from '@/stores/queueStore'
|
||||
import type { ToastMessageOptions } from 'primevue/toast'
|
||||
import { useToast } from 'primevue/usetoast'
|
||||
import { i18n } from '@/i18n'
|
||||
@@ -103,8 +106,10 @@ const init = () => {
|
||||
}
|
||||
|
||||
const queuePendingTaskCountStore = useQueuePendingTaskCountStore()
|
||||
const onStatus = (e: CustomEvent<StatusWsMessageStatus>) => {
|
||||
const queueStore = useQueueStore()
|
||||
const onStatus = async (e: CustomEvent<StatusWsMessageStatus>) => {
|
||||
queuePendingTaskCountStore.update(e)
|
||||
await queueStore.update()
|
||||
}
|
||||
|
||||
const reconnectingMessage: ToastMessageOptions = {
|
||||
|
||||
Reference in New Issue
Block a user