diff --git a/web/app/components/tools/mcp/detail/content.tsx b/web/app/components/tools/mcp/detail/content.tsx index 366b4d8b85..7d6525c104 100644 --- a/web/app/components/tools/mcp/detail/content.tsx +++ b/web/app/components/tools/mcp/detail/content.tsx @@ -54,13 +54,19 @@ const MCPDetailContent: FC = ({ const { mutateAsync: authorizeMcp, isPending: isAuthorizing } = useAuthorizeMCP() const toolList = data?.tools || [] + const [isShowUpdateConfirm, { + setTrue: showUpdateConfirm, + setFalse: hideUpdateConfirm, + }] = useBoolean(false) + const handleUpdateTools = useCallback(async () => { + hideUpdateConfirm() if (!detail) return await updateTools(detail.id) invalidateMCPTools(detail.id) onUpdate() - }, [detail, invalidateMCPTools, onUpdate, updateTools]) + }, [detail, hideUpdateConfirm, invalidateMCPTools, onUpdate, updateTools]) const { mutate: updateMCP } = useUpdateMCP({ onSuccess: onUpdate, @@ -231,7 +237,7 @@ const MCPDetailContent: FC = ({ {toolList.length === 1 &&
{t('tools.mcp.onlyTool')}
}
- @@ -279,6 +285,14 @@ const MCPDetailContent: FC = ({ isDisabled={deleting} /> )} + {isShowUpdateConfirm && ( + + )} ) }