fix(subscription): return chat paywalls after payment
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user