Skip to content

Commit c65aebb

Browse files
DrJKLampcode-com
andcommitted
fix(GraphCanvas): add ping-pong guard to palette setting watcher
Phase 4: Reactivity Fixes - prevent circular trigger when activePaletteId watcher sets Comfy.ColorPalette setting which would trigger the palette watcher back Amp-Thread-ID: https://ampcode.com/threads/T-019bf966-9b22-70af-a5be-1c9c2deb3d1e Co-authored-by: Amp <amp@ampcode.com>
1 parent 4ab0bdc commit c65aebb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/graph/GraphCanvas.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,10 @@ watch(
322322
watch(
323323
() => colorPaletteStore.activePaletteId,
324324
async (newValue) => {
325-
await settingStore.set('Comfy.ColorPalette', newValue)
325+
// Guard against ping-pong: only set if value actually differs
326+
if (newValue && settingStore.get('Comfy.ColorPalette') !== newValue) {
327+
await settingStore.set('Comfy.ColorPalette', newValue)
328+
}
326329
}
327330
)
328331

0 commit comments

Comments
 (0)