Skip to content

Commit c58f37a

Browse files
authored
🐛 fix: fixed the agent settings plugins pages error problem (#10437)
fix: fixed the agent settings plugins pages error problem
1 parent 3f95d1c commit c58f37a

File tree

1 file changed

+6
-2
lines changed
  • src/features/AgentSetting/AgentPlugin

1 file changed

+6
-2
lines changed

src/features/AgentSetting/AgentPlugin/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Avatar, Button, Form, type FormGroupItemType, Tag, Tooltip } from '@lob
44
import { Empty, Space, Switch } from 'antd';
55
import isEqual from 'fast-deep-equal';
66
import { LucideTrash2, Store } from 'lucide-react';
7-
import Link from 'next/link';
7+
import { Link, useNavigate } from 'react-router-dom';
88
import { memo, useState } from 'react';
99
import { Trans, useTranslation } from 'react-i18next';
1010
import { Center, Flexbox } from 'react-layout-kit';
@@ -29,6 +29,8 @@ const AgentPlugin = memo(() => {
2929

3030
const [showStore, setShowStore] = useState(false);
3131

32+
const navigate = useNavigate();
33+
3234
const [userEnabledPlugins, toggleAgentPlugin] = useStore((s) => [
3335
s.config.plugins || [],
3436
s.toggleAgentPlugin,
@@ -134,11 +136,13 @@ const AgentPlugin = memo(() => {
134136
<Trans i18nKey={'plugin.empty'} ns={'setting'}>
135137
暂无安装插件,
136138
<Link
137-
href={'/'}
138139
onClick={(e) => {
140+
e.stopPropagation();
139141
e.preventDefault();
140142
setShowStore(true);
143+
navigate('/discover/mcp');
141144
}}
145+
to={'/discover/mcp'}
142146
>
143147
前往插件市场
144148
</Link>

0 commit comments

Comments
 (0)