0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

fix(console): fix enterprise SSO creation model button status

This commit is contained in:
Darcy Ye 2024-08-16 11:43:37 +08:00
parent c0ca5b427c
commit 32a2d90cee
No known key found for this signature in database
GPG key ID: B46F4C07EDEFC610

View file

@ -131,13 +131,12 @@ function SsoCreationModal({ isOpen, onClose: rawOnClose }: Props) {
})
);
const isCreateButtonDisabled = useMemo(() => {
// The button is available only when:
// 1. `connectorName` field is not empty.
// 2. At least one connector is selected.
// 3. Error is resolved. Since `connectorName` is the only field of this form, it means `connectorName` field error is resolved.
return !(watch('connectorName') && isAnyConnectorSelected) || Boolean(errors.connectorName);
}, [errors.connectorName, isAnyConnectorSelected, watch]);
// The button is available only when:
// 1. `connectorName` field is not empty.
// 2. At least one connector is selected.
// 3. Error is resolved. Since `connectorName` is the only field of this form, it means `connectorName` field error is resolved.
const isCreateButtonDisabled =
!(watch('connectorName') && isAnyConnectorSelected) || Boolean(errors.connectorName);
if (!isOpen) {
return null;
@ -158,6 +157,7 @@ function SsoCreationModal({ isOpen, onClose: rawOnClose }: Props) {
paywall={conditional(
isDevFeaturesEnabled && planId === ReservedPlanId.Pro && ReservedPlanId.Pro
)}
hasAddOnTag={isDevFeaturesEnabled}
footer={
conditional(
isDevFeaturesEnabled &&