Merge pull request #649 from the-luap/fix/branding-customcss-preset-drop-645

fix(branding+whatsapp): preserve customCss through preset switches (#645) + admin-pinned WhatsApp template language (#647)
This commit is contained in:
Paul Nothaft
2026-06-21 21:33:29 +02:00
committed by GitHub
9 changed files with 144 additions and 13 deletions
@@ -259,7 +259,13 @@ export const ThemeCustomizerEnhanced: React.FC<ThemeCustomizerEnhancedProps> = (
if (preset) {
setSelectedPreset(presetKey);
setLocalTheme(preset.config);
setCustomCss(''); // Clear custom CSS when selecting a preset
// Don't wipe customCss on preset pick — preset configs carry no
// customCss, and the admin's persisted styling extras should
// survive a layout switch (#645). Matches ThemeCustomizer.tsx
// which never cleared it. The parent's handleThemeChange merges
// via `customCss: newTheme.customCss ?? currentTheme.customCss`,
// so propagating preset.config (no customCss) keeps the saved
// value intact end-to-end.
if (onPresetChange) {
onPresetChange(presetKey);
}