From 15022c77c098c5349a80bc5828d9216a75498e7d Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Fri, 10 Apr 2026 09:00:37 +0800 Subject: [PATCH] Gate checkout overlay by subscription recovery eligibility --- frontend/components/account/AccountCenter.tsx | 56 +++++++++++-------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/frontend/components/account/AccountCenter.tsx b/frontend/components/account/AccountCenter.tsx index 3d5cbda1..40938431 100644 --- a/frontend/components/account/AccountCenter.tsx +++ b/frontend/components/account/AccountCenter.tsx @@ -1482,6 +1482,11 @@ export function AccountCenter() { const showExpiringSoon = Boolean(isSubscribed && expiryInfo && !expiryInfo.expired && expiryInfo.daysLeft <= 3); const showExpiredReminder = Boolean(!isSubscribed && expiryInfo && expiryInfo.expired); + const paymentFeatureReady = paymentReadyForRecovery; + const canOpenCheckoutOverlay = Boolean( + paymentFeatureReady && + (!isSubscribed || showExpiringSoon || showExpiredReminder), + ); const subscriptionStatusTitle = showExpiredReminder ? isTrialPlan ? copy.trialExpiredTitle @@ -1506,7 +1511,7 @@ export function AccountCenter() { : ""; useEffect(() => { - if (!showOverlay || isSubscribed) return; + if (!showOverlay || !canOpenCheckoutOverlay) return; trackAppEvent("paywall_viewed", { entry: "account_center", user_state: isAuthenticated ? "logged_in" : "guest", @@ -1516,12 +1521,12 @@ export function AccountCenter() { }); }, [ isAuthenticated, - isSubscribed, - planCode, - showExpiredReminder, - showExpiringSoon, - showOverlay, - ]); + canOpenCheckoutOverlay, + planCode, + showExpiredReminder, + showExpiringSoon, + showOverlay, + ]); // Points Logic const backendPointsRaw = Number(backend?.points); @@ -1615,9 +1620,6 @@ export function AccountCenter() { (resolvedSelectedTokenAddress.startsWith("0x") ? shortAddress(resolvedSelectedTokenAddress) : "USDC"); - const paymentFeatureReady = Boolean( - paymentConfig?.enabled && paymentConfig?.configured, - ); const paymentReceiverAddress = String( selectedPaymentToken?.receiver_contract || paymentConfig?.receiver_contract || @@ -2397,15 +2399,17 @@ export function AccountCenter() {
- {!isSubscribed && !showOverlay && paymentFeatureReady && ( - - )} + {!showOverlay && canOpenCheckoutOverlay && ( + + )}