mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
feat: Let mode changes trigger a re-render for Vue nodes (#5599)
* feat: Let mode changes trigger a re-render for Vue nodes * Oops!
This commit is contained in:
@@ -789,19 +789,27 @@ export const useGraphNodeManager = (graph: LGraph): GraphNodeManager => {
|
|||||||
const currentData = vueNodeData.get(nodeId)
|
const currentData = vueNodeData.get(nodeId)
|
||||||
|
|
||||||
if (currentData) {
|
if (currentData) {
|
||||||
if (event.property === 'title') {
|
switch (event.property) {
|
||||||
vueNodeData.set(nodeId, {
|
case 'title':
|
||||||
...currentData,
|
vueNodeData.set(nodeId, {
|
||||||
title: String(event.newValue)
|
...currentData,
|
||||||
})
|
title: String(event.newValue)
|
||||||
} else if (event.property === 'flags.collapsed') {
|
})
|
||||||
vueNodeData.set(nodeId, {
|
break
|
||||||
...currentData,
|
case 'flags.collapsed':
|
||||||
flags: {
|
vueNodeData.set(nodeId, {
|
||||||
...currentData.flags,
|
...currentData,
|
||||||
collapsed: Boolean(event.newValue)
|
flags: {
|
||||||
}
|
...currentData.flags,
|
||||||
})
|
collapsed: Boolean(event.newValue)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
break
|
||||||
|
case 'mode':
|
||||||
|
vueNodeData.set(nodeId, {
|
||||||
|
...currentData,
|
||||||
|
mode: typeof event.newValue === 'number' ? event.newValue : 0
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,11 @@ import type { LGraphNode } from './LGraphNode'
|
|||||||
/**
|
/**
|
||||||
* Default properties to track
|
* Default properties to track
|
||||||
*/
|
*/
|
||||||
const DEFAULT_TRACKED_PROPERTIES: string[] = ['title', 'flags.collapsed']
|
const DEFAULT_TRACKED_PROPERTIES: string[] = [
|
||||||
|
'title',
|
||||||
|
'flags.collapsed',
|
||||||
|
'mode'
|
||||||
|
]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages node properties with optional change tracking and instrumentation.
|
* Manages node properties with optional change tracking and instrumentation.
|
||||||
|
|||||||
Reference in New Issue
Block a user