diff --git a/packages/console/src/components/ConnectorForm/ConfigForm/ConfigFormFields/index.tsx b/packages/console/src/components/ConnectorForm/ConfigForm/ConfigFormFields/index.tsx index facbc4380..b13ee2404 100644 --- a/packages/console/src/components/ConnectorForm/ConfigForm/ConfigFormFields/index.tsx +++ b/packages/console/src/components/ConnectorForm/ConfigForm/ConfigFormFields/index.tsx @@ -1,6 +1,5 @@ import type { ConnectorConfigFormItem } from '@logto/connector-kit'; import { ConnectorConfigFormItemType } from '@logto/connector-kit'; -import { conditional } from '@silverhand/essentials'; import { useMemo } from 'react'; import { Controller, useFormContext } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; @@ -49,10 +48,11 @@ function ConfigFormFields({ formItems }: Props) { }, [formItems, values]); const renderFormItem = (item: ConnectorConfigFormItem) => { - const error = conditional( - formConfigErrors && - (formConfigErrors[item.key]?.message ?? Boolean(formConfigErrors[item.key])) - ); + const errorMessage = formConfigErrors?.[item.key]?.message; + const error = + typeof errorMessage === 'string' && errorMessage.length > 0 + ? errorMessage + : Boolean(formConfigErrors?.[item.key]); const buildCommonProperties = () => ({ ...register(`formConfig.${item.key}`, { diff --git a/packages/console/src/pages/Connectors/Guide/index.tsx b/packages/console/src/pages/Connectors/Guide/index.tsx index ebf01827d..5b502a8a5 100644 --- a/packages/console/src/pages/Connectors/Guide/index.tsx +++ b/packages/console/src/pages/Connectors/Guide/index.tsx @@ -43,7 +43,7 @@ type Props = { }; function Guide({ connector, onClose }: Props) { - const { createConnector } = useConnectorApi({ hideErrorToast: true }); + const { createConnector } = useConnectorApi(); const { navigate } = useTenantPathname(); const callbackConnectorId = useRef(generateStandardId()); const [conflictConnectorName, setConflictConnectorName] = useState>();