Skip to content

Commit 085ed03

Browse files
committed
Fix Vue unwrap using markRaw
Involves minor runtime change.
1 parent 465903a commit 085ed03

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/stores/workflowStore.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Subgraph } from '@comfyorg/litegraph'
22
import _ from 'lodash'
33
import { defineStore } from 'pinia'
4-
import { computed, markRaw, ref, shallowRef, watch } from 'vue'
4+
import { type Raw, computed, markRaw, ref, shallowRef, watch } from 'vue'
55

66
import { ComfyWorkflowJSON } from '@/schemas/comfyWorkflowSchema'
77
import { api } from '@/scripts/api'
@@ -431,14 +431,14 @@ export const useWorkflowStore = defineStore('workflow', () => {
431431
const isSubgraphActive = ref(false)
432432

433433
/** @see WorkflowStore.activeSubgraph */
434-
const activeSubgraph = shallowRef<Subgraph>()
434+
const activeSubgraph = shallowRef<Raw<Subgraph>>()
435435

436436
/** @see WorkflowStore.updateActiveGraph */
437437
const updateActiveGraph = () => {
438-
activeSubgraph.value = comfyApp.canvas?.subgraph
438+
const subgraph = comfyApp.canvas?.subgraph
439+
activeSubgraph.value = subgraph ? markRaw(subgraph) : undefined
439440
if (!comfyApp.canvas) return
440441

441-
const { subgraph } = comfyApp.canvas
442442
isSubgraphActive.value = isSubgraph(subgraph)
443443
}
444444

0 commit comments

Comments
 (0)