|
|
|
@ -326,18 +326,11 @@ export default function RequestAcceptedClient() { |
|
|
|
// Signal Flutter to lift its loading cover immediately on mount
|
|
|
|
useHabibWebReady(true); |
|
|
|
|
|
|
|
const handleOpenProfile = async () => { |
|
|
|
if (!isFetched || isFetching) { |
|
|
|
setIsOpeningProfile(true); |
|
|
|
try { |
|
|
|
await refetchProfile(); |
|
|
|
} finally { |
|
|
|
setIsOpeningProfile(false); |
|
|
|
const handleOpenProfile = () => { |
|
|
|
openProfile(); |
|
|
|
if (!isFetched || isFetching) { |
|
|
|
refetchProfile().catch(() => {}); |
|
|
|
} |
|
|
|
return; |
|
|
|
} |
|
|
|
openProfile(); |
|
|
|
}; |
|
|
|
|
|
|
|
const isRedirecting = useMemo(() => { |
|
|
|
@ -411,11 +404,6 @@ export default function RequestAcceptedClient() { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (caseStatus === "female_accepted" || caseStatus === "payment_pending") { |
|
|
|
setIsSubscriptionSheetOpen(true); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (caseStatus === "payment_done" || caseStatus === "contacted") { |
|
|
|
if (!caseId) { |
|
|
|
return; |
|
|
|
@ -433,7 +421,11 @@ export default function RequestAcceptedClient() { |
|
|
|
setIsFetchingContact(false); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// Always fallback to opening subscription/payment sheet for any pending or introduced match
|
|
|
|
setIsSubscriptionSheetOpen(true); |
|
|
|
}; |
|
|
|
|
|
|
|
const handlePayment = async () => { |
|
|
|
@ -658,7 +650,7 @@ export default function RequestAcceptedClient() { |
|
|
|
}} |
|
|
|
planId={recommendedPlanId} |
|
|
|
onPayment={handlePayment} |
|
|
|
isPaymentPending={!recommendedPlanId || paymentMutation.isPending} |
|
|
|
isPaymentPending={paymentMutation.isPending} |
|
|
|
errorMessage={paymentError} |
|
|
|
showBuyCoins={isInsufficientCoins} |
|
|
|
/> |
|
|
|
@ -934,27 +926,13 @@ export default function RequestAcceptedClient() { |
|
|
|
paymentMutation.isPending || |
|
|
|
isFetchingContact |
|
|
|
} |
|
|
|
className={ |
|
|
|
isFemaleProfile |
|
|
|
? "flex-1 min-h-[48px] px-3.5 py-2.5 rounded-[14px] bg-gradient-to-r from-[#FF6687] to-[#FF456C] text-white font-bold text-[13.5px] leading-tight flex items-center justify-center text-center whitespace-nowrap shadow-sm transition-all duration-150 cursor-pointer hover:opacity-95 active:scale-[0.96] disabled:opacity-50 disabled:cursor-not-allowed" |
|
|
|
: "flex-1 min-h-[48px] appearance-none border-0 bg-transparent p-0 text-center cursor-pointer transition-transform duration-150 active:scale-[0.96] disabled:opacity-50 disabled:cursor-not-allowed" |
|
|
|
} |
|
|
|
className="flex-1 min-h-[48px] px-3.5 py-2.5 rounded-[14px] bg-gradient-to-r from-[#FF6687] to-[#FF456C] text-white font-bold text-[14px] leading-tight flex items-center justify-center text-center whitespace-nowrap shadow-sm transition-transform duration-150 active:scale-[0.96] cursor-pointer hover:opacity-95 disabled:opacity-50 disabled:cursor-not-allowed" |
|
|
|
> |
|
|
|
{isFemaleProfile ? ( |
|
|
|
paymentMutation.isPending ? ( |
|
|
|
<LoadingThreeDot className="text-white" /> |
|
|
|
) : ( |
|
|
|
secondaryActionText |
|
|
|
) |
|
|
|
) : ( |
|
|
|
<div className="w-full h-full min-h-[48px] px-3.5 py-2.5 rounded-[14px] bg-gradient-to-r from-[#FF6687] to-[#FF456C] text-white font-bold text-[14px] leading-tight flex items-center justify-center text-center whitespace-nowrap shadow-sm hover:opacity-95 active:shadow-inner"> |
|
|
|
{paymentMutation.isPending || isFetchingContact ? ( |
|
|
|
<LoadingThreeDot className="text-white" /> |
|
|
|
) : ( |
|
|
|
secondaryActionText |
|
|
|
)} |
|
|
|
</div> |
|
|
|
)} |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|