mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
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:
@@ -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]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user