diff --git a/src/components/Settings/SettingsDrawer.tsx b/src/components/Settings/SettingsDrawer.tsx index fe08e323b..c1eea6857 100644 --- a/src/components/Settings/SettingsDrawer.tsx +++ b/src/components/Settings/SettingsDrawer.tsx @@ -1,5 +1,7 @@ import { Drawer, ScrollArea, Tabs, Title } from '@mantine/core'; import { useTranslation } from 'next-i18next'; +import { useConfigContext } from '../../config/provider'; +import { useConfigStore } from '../../config/store'; import CommonSettings from './Common/CommonSettings'; import CustomizationSettings from './Customization/CustomizationSettings'; @@ -34,6 +36,8 @@ export function SettingsDrawer({ newVersionAvailable, }: SettingsDrawerProps & { newVersionAvailable: string }) { const { t } = useTranslation('settings/common'); + const { config, name: configName } = useConfigContext(); + const { updateConfig } = useConfigStore(); return ( {t('title')}} opened={opened} - onClose={closeDrawer} + onClose={() => { + closeDrawer(); + if (!configName || !config) { + return; + } + + updateConfig(configName, (_) => config, false, true); + }} >