mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
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:
@@ -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)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user