diff --git a/web/app/components/tools/edit-custom-collection-modal/test-api.tsx b/web/app/components/tools/edit-custom-collection-modal/test-api.tsx index 0079bad7c7..a03364aa3d 100644 --- a/web/app/components/tools/edit-custom-collection-modal/test-api.tsx +++ b/web/app/components/tools/edit-custom-collection-modal/test-api.tsx @@ -31,10 +31,13 @@ const TestApi: FC = ({ const language = getLanguage(locale) const [credentialsModalShow, setCredentialsModalShow] = useState(false) const [tempCredential, setTempCredential] = React.useState(customCollection.credentials) + const [testing, setTesting] = useState(false) const [result, setResult] = useState('') const { operation_id: toolName, parameters } = tool const [parametersValue, setParametersValue] = useState>({}) const handleTest = async () => { + if (testing) return + setTesting(true) // clone test schema const credentials = JSON.parse(JSON.stringify(tempCredential)) as Credential if (credentials.auth_type === AuthType.none) { @@ -52,6 +55,7 @@ const TestApi: FC = ({ } const res = await testAPIAvailable(data) as any setResult(res.error || res.result) + setTesting(false) } return ( @@ -107,7 +111,7 @@ const TestApi: FC = ({ - +
{t('tools.test.testResult')}