Fix terminal auth bootstrap and account checkout gate

This commit is contained in:
2569718930@qq.com
2026-06-14 05:52:44 +08:00
parent 1664925607
commit 0f00b00b5e
5 changed files with 64 additions and 4 deletions
@@ -410,7 +410,6 @@ export function AccountCenter() {
const canTrialUpgrade = Boolean(isSubscribed && isTrialSubscription);
const canOpenCheckoutOverlay = Boolean(
paymentFeatureReady &&
!isSubscriptionUnknown &&
(canTrialUpgrade || !isSubscribed || showExpiringSoon || showExpiredReminder),
);
const subscriptionStatusTitle = showExpiredReminder
@@ -253,6 +253,17 @@ export function runTests() {
),
"account center must distinguish unknown subscription sync state from a confirmed unsubscribed account",
);
assert(
!accountCenterSource.includes("paymentFeatureReady &&\n !isSubscriptionUnknown") &&
!accountCenterSource.includes("paymentFeatureReady &&\r\n !isSubscriptionUnknown"),
"account center must not block checkout when an authenticated user's subscription status is temporarily unknown",
);
assert(
accountFeatureSource.includes("状态待确认") &&
accountFeatureSource.includes("刷新或直接续费") &&
!accountFeatureSource.includes("订阅状态正在同步,请稍后刷新。"),
"account unknown subscription copy must tell users to refresh or renew instead of waiting indefinitely",
);
assert(
hookSource.includes("backendJson.authenticated === false") &&
hookSource.includes("refreshSession()") &&
+3 -3
View File
@@ -165,10 +165,10 @@ export function createAccountCopy(isEn: boolean): Record<string, string> {
: "钱包已绑定,正在创建订单并发起支付...",
proMember: "PRO MEMBER",
proPendingSync: isEn ? "Activated (pending sync)" : "已开通(待同步)",
subscriptionChecking: isEn ? "Checking subscription" : "订阅同步中",
subscriptionChecking: isEn ? "Status pending" : "状态待确认",
subscriptionUnknown: isEn
? "Subscription status is syncing. Please refresh shortly."
: "订阅状态正在同步,请稍后刷新。",
? "Subscription status is not confirmed yet. Refresh or renew directly."
: "订阅状态暂未确认,可刷新或直接续费。",
noProSubscription: isEn ? "No Pro subscription" : "暂无 Pro 订阅",
proEndsSoonTitle: isEn ? "Pro renewal due soon" : "Pro 即将到期",
proEndsSoonBody: isEn