fix(subscription): return chat paywalls after payment

This commit is contained in:
2026-06-25 10:20:13 +08:00
parent 9555a173b5
commit c8f0827e40
7 changed files with 58 additions and 14 deletions
+9 -9
View File
@@ -56,6 +56,9 @@ export function ChatScreen() {
const inlineUpgradeCta = "Activate VIP to view private messages";
const externalBrowserPromptShownRef = useRef(false);
const chatPaywallSubscriptionUrl = ROUTE_BUILDERS.subscription("vip", {
returnTo: "chat",
});
useEffect(() => {
if (!authState.hasInitialized || authState.isLoading) return;
@@ -127,30 +130,27 @@ export function ChatScreen() {
}
function handleUnlockPrivateMessage(): void {
const subscriptionUrl = ROUTE_BUILDERS.subscription("vip");
if (isGuest) {
router.push(ROUTE_BUILDERS.authWithRedirect(subscriptionUrl));
router.push(ROUTE_BUILDERS.authWithRedirect(chatPaywallSubscriptionUrl));
return;
}
router.push(subscriptionUrl);
router.push(chatPaywallSubscriptionUrl);
}
function handleUnlockImagePaywall(): void {
const subscriptionUrl = ROUTE_BUILDERS.subscription("vip");
if (isGuest) {
router.push(ROUTE_BUILDERS.authWithRedirect(subscriptionUrl));
router.push(ROUTE_BUILDERS.authWithRedirect(chatPaywallSubscriptionUrl));
return;
}
router.push(subscriptionUrl);
router.push(chatPaywallSubscriptionUrl);
}
function handleMessageLimitUnlock(): void {
const subscriptionUrl = ROUTE_BUILDERS.subscription("vip");
if (isGuest) {
router.push(ROUTE_BUILDERS.authWithRedirect(subscriptionUrl));
router.push(ROUTE_BUILDERS.authWithRedirect(chatPaywallSubscriptionUrl));
return;
}
router.push(subscriptionUrl);
router.push(chatPaywallSubscriptionUrl);
}
return (