Skip to content

Commit 6d09b71

Browse files
authored
[TS] Fix event type for executing listener (#3310)
1 parent 8fc6840 commit 6d09b71

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/components/graph/GraphCanvas.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ import { usePaste } from '@/composables/usePaste'
6262
import { useWorkflowPersistence } from '@/composables/useWorkflowPersistence'
6363
import { CORE_SETTINGS } from '@/constants/coreSettings'
6464
import { i18n } from '@/i18n'
65+
import type { NodeId } from '@/schemas/comfyWorkflowSchema'
6566
import { UnauthorizedError, api } from '@/scripts/api'
6667
import { app as comfyApp } from '@/scripts/app'
6768
import { ChangeTracker } from '@/scripts/changeTracker'
@@ -165,7 +166,7 @@ watch(
165166
watch(
166167
() =>
167168
[executionStore.executingNodeId, executionStore.executingNodeProgress] as [
168-
string | null,
169+
NodeId | null,
169170
number | null
170171
],
171172
([executingNodeId, executingNodeProgress]) => {

src/scripts/app.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export class ComfyApp {
162162
/**
163163
* @deprecated Use useExecutionStore().executingNodeId instead
164164
*/
165-
get runningNodeId(): string | null {
165+
get runningNodeId(): NodeId | null {
166166
return useExecutionStore().executingNodeId
167167
}
168168

src/stores/executionStore.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { computed, ref } from 'vue'
33

44
import type {
55
ExecutedWsMessage,
6-
ExecutingWsMessage,
76
ExecutionCachedWsMessage,
87
ExecutionErrorWsMessage,
98
ExecutionStartWsMessage,
@@ -37,7 +36,7 @@ export const useExecutionStore = defineStore('execution', () => {
3736
const queuedPrompts = ref<Record<NodeId, QueuedPrompt>>({})
3837
const lastNodeErrors = ref<Record<NodeId, NodeError> | null>(null)
3938
const lastExecutionError = ref<ExecutionErrorWsMessage | null>(null)
40-
const executingNodeId = ref<string | null>(null)
39+
const executingNodeId = ref<NodeId | null>(null)
4140
const executingNode = computed<ComfyNode | null>(() => {
4241
if (!executingNodeId.value) return null
4342

@@ -142,7 +141,7 @@ export const useExecutionStore = defineStore('execution', () => {
142141
activePrompt.value.nodes[e.detail.node] = true
143142
}
144143

145-
function handleExecuting(e: CustomEvent<ExecutingWsMessage>) {
144+
function handleExecuting(e: CustomEvent<NodeId | null>) {
146145
// Clear the current node progress when a new node starts executing
147146
_executingNodeProgress.value = null
148147

@@ -152,8 +151,8 @@ export const useExecutionStore = defineStore('execution', () => {
152151
// Seems sometimes nodes that are cached fire executing but not executed
153152
activePrompt.value.nodes[executingNodeId.value] = true
154153
}
155-
executingNodeId.value = e.detail ? String(e.detail) : null
156-
if (!executingNodeId.value) {
154+
executingNodeId.value = e.detail
155+
if (executingNodeId.value === null) {
157156
if (activePromptId.value) {
158157
delete queuedPrompts.value[activePromptId.value]
159158
}

0 commit comments

Comments
 (0)