0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-06 20:40:08 -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: // The button is available only when:
// 1. `connectorName` field is not empty. // 1. `connectorName` field is not empty.
// 2. At least one connector is selected. // 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. // 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); const isCreateButtonDisabled =
}, [errors.connectorName, isAnyConnectorSelected, watch]); !(watch('connectorName') && isAnyConnectorSelected) || Boolean(errors.connectorName);
if (!isOpen) { if (!isOpen) {
return null; return null;
@ -158,6 +157,7 @@ function SsoCreationModal({ isOpen, onClose: rawOnClose }: Props) {
paywall={conditional( paywall={conditional(
isDevFeaturesEnabled && planId === ReservedPlanId.Pro && ReservedPlanId.Pro isDevFeaturesEnabled && planId === ReservedPlanId.Pro && ReservedPlanId.Pro
)} )}
hasAddOnTag={isDevFeaturesEnabled}
footer={ footer={
conditional( conditional(
isDevFeaturesEnabled && isDevFeaturesEnabled &&