[TS] Fix event type for executing listener (#3310)

This commit is contained in:
Chenlei Hu
2025-04-02 11:16:36 -04:00
committed by GitHub
parent 8fc6840434
commit 6d09b7165f
3 changed files with 7 additions and 7 deletions

View File

@@ -62,6 +62,7 @@ import { usePaste } from '@/composables/usePaste'
import { useWorkflowPersistence } from '@/composables/useWorkflowPersistence'
import { CORE_SETTINGS } from '@/constants/coreSettings'
import { i18n } from '@/i18n'
import type { NodeId } from '@/schemas/comfyWorkflowSchema'
import { UnauthorizedError, api } from '@/scripts/api'
import { app as comfyApp } from '@/scripts/app'
import { ChangeTracker } from '@/scripts/changeTracker'
@@ -165,7 +166,7 @@ watch(
watch(
() =>
[executionStore.executingNodeId, executionStore.executingNodeProgress] as [
string | null,
NodeId | null,
number | null
],
([executingNodeId, executingNodeProgress]) => {

View File

@@ -162,7 +162,7 @@ export class ComfyApp {
/**
* @deprecated Use useExecutionStore().executingNodeId instead
*/
get runningNodeId(): string | null {
get runningNodeId(): NodeId | null {
return useExecutionStore().executingNodeId
}

View File

@@ -3,7 +3,6 @@ import { computed, ref } from 'vue'
import type {
ExecutedWsMessage,
ExecutingWsMessage,
ExecutionCachedWsMessage,
ExecutionErrorWsMessage,
ExecutionStartWsMessage,
@@ -37,7 +36,7 @@ export const useExecutionStore = defineStore('execution', () => {
const queuedPrompts = ref<Record<NodeId, QueuedPrompt>>({})
const lastNodeErrors = ref<Record<NodeId, NodeError> | null>(null)
const lastExecutionError = ref<ExecutionErrorWsMessage | null>(null)
const executingNodeId = ref<string | null>(null)
const executingNodeId = ref<NodeId | null>(null)
const executingNode = computed<ComfyNode | null>(() => {
if (!executingNodeId.value) return null
@@ -142,7 +141,7 @@ export const useExecutionStore = defineStore('execution', () => {
activePrompt.value.nodes[e.detail.node] = true
}
function handleExecuting(e: CustomEvent<ExecutingWsMessage>) {
function handleExecuting(e: CustomEvent<NodeId | null>) {
// Clear the current node progress when a new node starts executing
_executingNodeProgress.value = null
@@ -152,8 +151,8 @@ export const useExecutionStore = defineStore('execution', () => {
// Seems sometimes nodes that are cached fire executing but not executed
activePrompt.value.nodes[executingNodeId.value] = true
}
executingNodeId.value = e.detail ? String(e.detail) : null
if (!executingNodeId.value) {
executingNodeId.value = e.detail
if (executingNodeId.value === null) {
if (activePromptId.value) {
delete queuedPrompts.value[activePromptId.value]
}