Skip to content

Commit

Permalink
Fix Comfy.WidgetControlMode watcher (#2079)
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei authored Dec 28, 2024
1 parent feabd3f commit af1a5d9
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions src/components/graph/GraphCanvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,22 +196,27 @@ watchEffect(() => {
LiteGraph.alwaysSnapToGrid = settingStore.get('pysssss.SnapToGrid')
})
watch(settingStore.get('Comfy.WidgetControlMode'), () => {
for (const n of comfyApp.graph.nodes) {
if (!n.widgets) continue
for (const w of n.widgets) {
if (w[IS_CONTROL_WIDGET]) {
updateControlWidgetLabel(w)
if (w.linkedWidgets) {
for (const l of w.linkedWidgets) {
updateControlWidgetLabel(l)
watch(
() => settingStore.get('Comfy.WidgetControlMode'),
() => {
if (!canvasStore.canvas) return
for (const n of comfyApp.graph.nodes) {
if (!n.widgets) continue
for (const w of n.widgets) {
if (w[IS_CONTROL_WIDGET]) {
updateControlWidgetLabel(w)
if (w.linkedWidgets) {
for (const l of w.linkedWidgets) {
updateControlWidgetLabel(l)
}
}
}
}
}
comfyApp.graph.setDirtyCanvas(true)
}
comfyApp.graph.setDirtyCanvas(true)
})
)
watchEffect(() => {
if (!canvasStore.canvas) return
Expand Down

0 comments on commit af1a5d9

Please sign in to comment.