This commit is contained in:
bietiaop
2025-02-09 00:17:49 +08:00
parent 96d79cf495
commit 1702f429b4
5 changed files with 26 additions and 10 deletions

View File

@@ -7,6 +7,8 @@ import ColorPicker from '@/components/ColorPicker'
import SaveButtons from '@/components/button/save_buttons'
import PageLoading from '@/components/page_loading'
import { loadTheme } from '@/utils/theme'
import WebUIManager from '@/controllers/webui_manager'
const ThemeConfigCard = () => {
@@ -33,10 +35,11 @@ const ThemeConfigCard = () => {
if (data) setOnebotValue('theme', data)
}
const onSubmit = handleOnebotSubmit((data) => {
const onSubmit = handleOnebotSubmit(async (data) => {
try {
WebUIManager.setThemeConfig(data.theme)
await WebUIManager.setThemeConfig(data.theme)
toast.success('保存成功')
loadTheme()
} catch (error) {
const msg = (error as Error).message
toast.error(`保存失败: ${msg}`)