fix: theme config (#1161)

Co-authored-by: sealday <sealday@gmail.com>
Reviewed-on: daoyoucloud/tachybase#1161
This commit is contained in:
sealday 2024-06-12 13:38:12 +08:00
parent 059836f4bc
commit c15e594855

View File

@ -1,5 +1,5 @@
import React, { useCallback, useMemo } from 'react'; import React, { useCallback, useMemo } from 'react';
import { compatOldTheme, useAPIClient, useCurrentUserContext, useGlobalTheme, useToken } from '@tachybase/client'; import { useAPIClient, useCurrentUserContext, useGlobalTheme, useToken } from '@tachybase/client';
import { error } from '@tachybase/utils/client'; import { error } from '@tachybase/utils/client';
import { DeleteOutlined, EditOutlined, EllipsisOutlined } from '@ant-design/icons'; import { DeleteOutlined, EditOutlined, EllipsisOutlined } from '@ant-design/icons';
@ -178,7 +178,7 @@ const ThemeCard = (props: Props) => {
const handleEdit = useCallback(() => { const handleEdit = useCallback(() => {
setCurrentSettingTheme(currentTheme); setCurrentSettingTheme(currentTheme);
setCurrentEditingTheme(item); setCurrentEditingTheme(item);
setTheme(compatOldTheme(item.config)); setTheme(item.config);
setOpen(true); setOpen(true);
}, [item, setCurrentEditingTheme, setCurrentSettingTheme, setOpen, setTheme, currentTheme]); }, [item, setCurrentEditingTheme, setCurrentSettingTheme, setOpen, setTheme, currentTheme]);