mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 16:56:22 +02:00
refactor: remove unused tool availability logic from ComposerAction component
This commit is contained in:
parent
b092d8d13d
commit
5908a64c1d
1 changed files with 0 additions and 24 deletions
|
|
@ -684,30 +684,6 @@ const ComposerAction: FC<ComposerActionProps> = ({ isBlockedByOtherUser = false
|
|||
hydrateDisabled();
|
||||
}, [hydrateDisabled]);
|
||||
|
||||
useEffect(() => {
|
||||
const unavailable: string[] = [];
|
||||
for (const group of TOOL_GROUPS) {
|
||||
if (!group.connectorIcon) continue;
|
||||
const requiredTypes = CONNECTOR_ICON_TO_TYPES[group.connectorIcon];
|
||||
const isConnected = requiredTypes?.some((t) => connectedTypes.has(t));
|
||||
if (!isConnected) {
|
||||
unavailable.push(...group.tools);
|
||||
}
|
||||
}
|
||||
if (unavailable.length === 0) return;
|
||||
setDisabledTools((prev) => {
|
||||
const next = new Set(prev);
|
||||
let changed = false;
|
||||
for (const name of unavailable) {
|
||||
if (!next.has(name)) {
|
||||
next.add(name);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
return changed ? [...next] : prev;
|
||||
});
|
||||
}, [connectedTypes, setDisabledTools]);
|
||||
|
||||
const hasModelConfigured = useMemo(() => {
|
||||
if (!preferences) return false;
|
||||
const agentLlmId = preferences.agent_llm_id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue