Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix: fixed the agent settings plugins pages error problem (#10437)

Shinji-Lic58f37ad969e
diff --git a/src/features/AgentSetting/AgentPlugin/index.tsx b/src/features/AgentSetting/AgentPlugin/index.tsx
index c4b21f0c0c3..98406f6e5a9 100644
--- a/src/features/AgentSetting/AgentPlugin/index.tsx
+++ b/src/features/AgentSetting/AgentPlugin/index.tsx
@@ -4,7 +4,7 @@ import { Avatar, Button, Form, type FormGroupItemType, Tag, Tooltip } from '@lob
import { Empty, Space, Switch } from 'antd';
import isEqual from 'fast-deep-equal';
import { LucideTrash2, Store } from 'lucide-react';
-import Link from 'next/link';
+import { Link, useNavigate } from 'react-router-dom';
import { memo, useState } from 'react';
import { Trans, useTranslation } from 'react-i18next';
import { Center, Flexbox } from 'react-layout-kit';
@@ -29,6 +29,8 @@ const AgentPlugin = memo(() => {
const [showStore, setShowStore] = useState(false);
+ const navigate = useNavigate();
+
const [userEnabledPlugins, toggleAgentPlugin] = useStore((s) => [
s.config.plugins || [],
s.toggleAgentPlugin,
@@ -134,11 +136,13 @@ const AgentPlugin = memo(() => {
<Trans i18nKey={'plugin.empty'} ns={'setting'}>
暂无安装插件,
<Link
- href={'/'}
onClick={(e) => {
+ e.stopPropagation();
e.preventDefault();
setShowStore(true);
+ navigate('/discover/mcp');
}}
+ to={'/discover/mcp'}
>
前往插件市场
</Link>