diff --git a/src/pages/ConfigPage.tsx b/src/pages/ConfigPage.tsx index 08c194b..3c0e45c 100644 --- a/src/pages/ConfigPage.tsx +++ b/src/pages/ConfigPage.tsx @@ -20,7 +20,7 @@ import { VisualConfigEditor } from '@/components/config/VisualConfigEditor'; import { DiffModal } from '@/components/config/DiffModal'; import { useMediaQuery } from '@/hooks/useMediaQuery'; import { useVisualConfig } from '@/hooks/useVisualConfig'; -import { useNotificationStore, useAuthStore, useThemeStore } from '@/stores'; +import { useNotificationStore, useAuthStore, useThemeStore, useConfigStore } from '@/stores'; import { configFileApi } from '@/services/api/configFile'; import styles from './ConfigPage.module.scss'; @@ -139,6 +139,24 @@ export function ConfigPage() { setServerYaml(latestContent); setMergedYaml(latestContent); loadVisualValuesFromYaml(latestContent); + + // Keep the global config store in sync so sidebar / other pages reflect YAML changes immediately. + try { + useConfigStore.getState().clearCache(); + await useConfigStore.getState().fetchConfig(undefined, true); + } catch (refreshError: unknown) { + const message = + refreshError instanceof Error + ? refreshError.message + : typeof refreshError === 'string' + ? refreshError + : ''; + showNotification( + `${t('notification.refresh_failed')}${message ? `: ${message}` : ''}`, + 'error' + ); + } + showNotification(t('config_management.save_success'), 'success'); if (commercialModeChanged) { showNotification(t('notification.commercial_mode_restart_required'), 'warning');