fix(chat): redirect guests before quota upgrade
This commit is contained in:
@@ -49,7 +49,6 @@ export function ChatScreen() {
|
|||||||
const showMessageLimitBanner =
|
const showMessageLimitBanner =
|
||||||
state.upgradePromptVisible && state.upgradeReason === "daily_limit";
|
state.upgradePromptVisible && state.upgradeReason === "daily_limit";
|
||||||
const messageLimitTitle = "The limit for free chat times\nhas been reached";
|
const messageLimitTitle = "The limit for free chat times\nhas been reached";
|
||||||
const messageLimitCta = isGuest ? "Log in to continue chatting" : undefined;
|
|
||||||
|
|
||||||
const showPrivatePaywallBanner =
|
const showPrivatePaywallBanner =
|
||||||
state.upgradePromptVisible && state.upgradeReason === "private_message";
|
state.upgradePromptVisible && state.upgradeReason === "private_message";
|
||||||
@@ -142,11 +141,12 @@ export function ChatScreen() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleMessageLimitUnlock(): void {
|
function handleMessageLimitUnlock(): void {
|
||||||
|
const subscriptionUrl = ROUTE_BUILDERS.subscription("vip");
|
||||||
if (isGuest) {
|
if (isGuest) {
|
||||||
router.push(ROUTES.auth);
|
router.push(ROUTE_BUILDERS.authWithRedirect(subscriptionUrl));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
router.push(ROUTE_BUILDERS.subscription("vip"));
|
router.push(subscriptionUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -186,7 +186,6 @@ export function ChatScreen() {
|
|||||||
{showMessageLimitBanner ? (
|
{showMessageLimitBanner ? (
|
||||||
<ChatQuotaExhaustedBanner
|
<ChatQuotaExhaustedBanner
|
||||||
title={messageLimitTitle}
|
title={messageLimitTitle}
|
||||||
ctaLabel={messageLimitCta}
|
|
||||||
onUnlock={handleMessageLimitUnlock}
|
onUnlock={handleMessageLimitUnlock}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
Reference in New Issue
Block a user