From ab80e311b56e4e1fc1b4eca851b52db3af28f79c Mon Sep 17 00:00:00 2001 From: Fringg Date: Sat, 7 Feb 2026 03:45:17 +0300 Subject: [PATCH] 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. --- src/components/admin/ThemeTab.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/admin/ThemeTab.tsx b/src/components/admin/ThemeTab.tsx index 7938473..3bfad07 100644 --- a/src/components/admin/ThemeTab.tsx +++ b/src/components/admin/ThemeTab.tsx @@ -85,8 +85,8 @@ export function ThemeTab() { colorsEqual(savedColorsRef.current, DEFAULT_THEME_COLORS) ) { setDraftColors(colors); + savedColorsRef.current = colors; } - savedColorsRef.current = colors; } }, [serverColors]);