Skip to content

Commit 7af0ec6

Browse files
authored
🐛 fix: the agent setting -edit_agent not work (#4609)
* 🐛 fix: the agent setting `-edit_agent` not work * Update index.tsx
1 parent 64caf2e commit 7af0ec6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/features/AgentSetting/AgentMeta/index.tsx

+12-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { memo } from 'react';
99
import { useTranslation } from 'react-i18next';
1010

1111
import { FORM_STYLE } from '@/const/layoutTokens';
12+
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
1213
import { INBOX_SESSION_ID } from '@/const/session';
1314

1415
import { useStore } from '../store';
@@ -21,6 +22,8 @@ import BackgroundSwatches from './BackgroundSwatches';
2122
const AgentMeta = memo(() => {
2223
const { t } = useTranslation('setting');
2324

25+
const { isAgentEditable } = useServerConfigStore(featureFlagsSelectors);
26+
2427
const [hasSystemRole, updateMeta, autocompleteMeta, autocompleteAllMeta] = useStore((s) => [
2528
!!s.config.systemRole,
2629
s.setAgentMeta,
@@ -139,7 +142,15 @@ const AgentMeta = memo(() => {
139142
title: t('settingAgent.title'),
140143
};
141144

142-
return <Form items={[metaData]} itemsType={'group'} variant={'pure'} {...FORM_STYLE} />;
145+
return (
146+
<Form
147+
disabled={!isAgentEditable}
148+
items={[metaData]}
149+
itemsType={'group'}
150+
variant={'pure'}
151+
{...FORM_STYLE}
152+
/>
153+
);
143154
});
144155

145156
export default AgentMeta;

0 commit comments

Comments
 (0)