diff --git a/src/pages/OldCommon/components/CommonDetailContainer/MembershipRequestModal/MembershipRequestModal.tsx b/src/pages/OldCommon/components/CommonDetailContainer/MembershipRequestModal/MembershipRequestModal.tsx index b491a096e6..f9c980749a 100644 --- a/src/pages/OldCommon/components/CommonDetailContainer/MembershipRequestModal/MembershipRequestModal.tsx +++ b/src/pages/OldCommon/components/CommonDetailContainer/MembershipRequestModal/MembershipRequestModal.tsx @@ -51,7 +51,7 @@ const INIT_DATA: IMembershipRequestData = { interface IProps extends Pick { common: Common; governance: Governance; - shouldShowLoadingAfterSuccessfulCreation?: boolean; + showLoadingAfterSuccessfulCreation?: boolean; onCreationStageReach?: (reached: boolean) => void; onRequestCreated?: () => void; } @@ -69,7 +69,7 @@ export function MembershipRequestModal(props: IProps) { onClose, common, governance, - shouldShowLoadingAfterSuccessfulCreation = false, + showLoadingAfterSuccessfulCreation = false, onCreationStageReach, onRequestCreated, } = props; @@ -189,7 +189,7 @@ export function MembershipRequestModal(props: IProps) { /> ); case MembershipRequestStage.Created: - return shouldShowLoadingAfterSuccessfulCreation ? ( + return showLoadingAfterSuccessfulCreation && isAutomaticAcceptance ? ( = (props) => { onClose={handleCommonJoinModalClose} common={common} governance={governance} - shouldShowLoadingAfterSuccessfulCreation={ - governance.proposals[ProposalsTypes.MEMBER_ADMITTANCE]?.global - .votingDuration === 0 - } onRequestCreated={handleCommonJoinRequestCreated} + showLoadingAfterSuccessfulCreation /> = ( [getCommonPagePath, handleFeedItemClick], ); + useEffect(() => { + if (commonMember && isCommonJoinModalOpen) { + onCommonJoinModalClose(); + } + }, [commonMember?.id]); + useEffect(() => { if (!outerGovernance && selectedItemCommonData?.id) { fetchGovernance(selectedItemCommonData.id); @@ -805,6 +811,7 @@ const FeedLayout: ForwardRefRenderFunction = ( onClose={onCommonJoinModalClose} common={outerCommon} governance={governance} + showLoadingAfterSuccessfulCreation />