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>
This commit is contained in:
Alexander Brown
2026-01-26 00:24:54 -08:00
parent 4ab0bdcc91
commit c65aebbe0c

View File

@@ -322,7 +322,10 @@ watch(
watch(
() => colorPaletteStore.activePaletteId,
async (newValue) => {
await settingStore.set('Comfy.ColorPalette', newValue)
// Guard against ping-pong: only set if value actually differs
if (newValue && settingStore.get('Comfy.ColorPalette') !== newValue) {
await settingStore.set('Comfy.ColorPalette', newValue)
}
}
)