fix: theme custom colors save button not appearing

savedColorsRef was unconditionally updated in the serverColors sync
effect, including when queryClient.setQueryData was called from
updateDraftColor for live preview. This made hasUnsavedChanges always
false, hiding the save/cancel buttons. Move savedColorsRef update
inside the sync condition so it only updates when no local edits exist.
This commit is contained in:
Fringg
2026-02-07 03:45:17 +03:00
parent b7aca0cc1c
commit ab80e311b5

View File

@@ -85,8 +85,8 @@ export function ThemeTab() {
colorsEqual(savedColorsRef.current, DEFAULT_THEME_COLORS) colorsEqual(savedColorsRef.current, DEFAULT_THEME_COLORS)
) { ) {
setDraftColors(colors); setDraftColors(colors);
savedColorsRef.current = colors;
} }
savedColorsRef.current = colors;
} }
}, [serverColors]); }, [serverColors]);