From 5840c35f44c71b639bfee0ceba3f47518a1b4fd6 Mon Sep 17 00:00:00 2001 From: Egor Date: Mon, 19 Jan 2026 10:28:02 +0300 Subject: [PATCH] Update AdminSettings.tsx --- src/pages/AdminSettings.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/AdminSettings.tsx b/src/pages/AdminSettings.tsx index c3bc9de..ccd878a 100644 --- a/src/pages/AdminSettings.tsx +++ b/src/pages/AdminSettings.tsx @@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next' import { Link } from 'react-router-dom' import { adminSettingsApi, SettingDefinition, SettingCategorySummary } from '../api/adminSettings' import { brandingApi } from '../api/branding' +import { setCachedAnimationEnabled } from '../components/AnimatedBackground' import { themeColorsApi } from '../api/themeColors' import { DEFAULT_THEME_COLORS, DEFAULT_ENABLED_THEMES } from '../types/theme' import { ColorPicker } from '../components/ColorPicker' @@ -872,7 +873,9 @@ export default function AdminSettings() { const updateAnimationMutation = useMutation({ mutationFn: (enabled: boolean) => brandingApi.updateAnimationEnabled(enabled), - onSuccess: () => { + onSuccess: (data) => { + // Update local cache immediately for instant effect + setCachedAnimationEnabled(data.enabled) queryClient.invalidateQueries({ queryKey: ['animation-enabled'] }) }, })