mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-07 12:35:59 +08:00
feat: Optimize MCP configuration logic
This commit is contained in:
@@ -29,6 +29,8 @@ import { getClientConfig } from "../config/client";
|
||||
import { type ClientApi, getClientApi } from "../client/api";
|
||||
import { useAccessStore } from "../store";
|
||||
import clsx from "clsx";
|
||||
import { initializeMcpSystem } from "../mcp/actions";
|
||||
import { showToast } from "./ui-lib";
|
||||
|
||||
export function Loading(props: { noLogo?: boolean }) {
|
||||
return (
|
||||
@@ -243,6 +245,14 @@ export function Home() {
|
||||
useAccessStore.getState().fetch();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
// 初始化 MCP 系统
|
||||
initializeMcpSystem().catch((error) => {
|
||||
console.error("Failed to initialize MCP system:", error);
|
||||
showToast("Failed to initialize MCP system");
|
||||
});
|
||||
}, []);
|
||||
|
||||
if (!useHasHydrated()) {
|
||||
return <Loading />;
|
||||
}
|
||||
|
Reference in New Issue
Block a user