refactor(chat): remove private unlock machine flow
This commit is contained in:
@@ -49,12 +49,6 @@ export function ChatScreen() {
|
||||
state.upgradePromptVisible && state.upgradeReason === "daily_limit";
|
||||
const messageLimitTitle = "The limit for free chat times\nhas been reached";
|
||||
|
||||
const showPrivatePaywallBanner =
|
||||
state.upgradePromptVisible && state.upgradeReason === "private_message";
|
||||
|
||||
const inlineUpgradeTitle = "Unlock VIP to view private messages";
|
||||
const inlineUpgradeCta = "Activate VIP to view private messages";
|
||||
|
||||
const externalBrowserPromptShownRef = useRef(false);
|
||||
const chatPaywallSubscriptionUrl = ROUTE_BUILDERS.subscription("vip", {
|
||||
returnTo: "chat",
|
||||
@@ -129,7 +123,7 @@ export function ChatScreen() {
|
||||
UrlLauncherUtil.openUrlWithExternalBrowser(ROUTES.splash);
|
||||
}
|
||||
|
||||
function handleUnlockPrivateMessage(): void {
|
||||
function openChatPaywallSubscription(): void {
|
||||
if (isGuest) {
|
||||
router.push(ROUTE_BUILDERS.authWithRedirect(chatPaywallSubscriptionUrl));
|
||||
return;
|
||||
@@ -137,28 +131,20 @@ export function ChatScreen() {
|
||||
router.push(chatPaywallSubscriptionUrl);
|
||||
}
|
||||
|
||||
function handleUnlockPrivateMessage(): void {
|
||||
openChatPaywallSubscription();
|
||||
}
|
||||
|
||||
function handleUnlockImagePaywall(): void {
|
||||
if (isGuest) {
|
||||
router.push(ROUTE_BUILDERS.authWithRedirect(chatPaywallSubscriptionUrl));
|
||||
return;
|
||||
}
|
||||
router.push(chatPaywallSubscriptionUrl);
|
||||
openChatPaywallSubscription();
|
||||
}
|
||||
|
||||
function handleMessageLimitUnlock(): void {
|
||||
if (isGuest) {
|
||||
router.push(ROUTE_BUILDERS.authWithRedirect(chatPaywallSubscriptionUrl));
|
||||
return;
|
||||
}
|
||||
router.push(chatPaywallSubscriptionUrl);
|
||||
openChatPaywallSubscription();
|
||||
}
|
||||
|
||||
function handleUnlockVoiceMessage(): void {
|
||||
if (isGuest) {
|
||||
router.push(ROUTE_BUILDERS.authWithRedirect(chatPaywallSubscriptionUrl));
|
||||
return;
|
||||
}
|
||||
router.push(chatPaywallSubscriptionUrl);
|
||||
openChatPaywallSubscription();
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -183,19 +169,11 @@ export function ChatScreen() {
|
||||
messages={state.messages}
|
||||
isReplyingAI={state.isReplyingAI}
|
||||
isGuest={isGuest}
|
||||
unlockingPrivateMessageId={state.unlockingPrivateMessageId}
|
||||
onUnlockPrivateMessage={handleUnlockPrivateMessage}
|
||||
onUnlockImagePaywall={handleUnlockImagePaywall}
|
||||
onUnlockVoiceMessage={handleUnlockVoiceMessage}
|
||||
/>
|
||||
|
||||
{showPrivatePaywallBanner ? (
|
||||
<ChatQuotaExhaustedBanner
|
||||
title={inlineUpgradeTitle}
|
||||
ctaLabel={inlineUpgradeCta}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
{showMessageLimitBanner ? (
|
||||
<ChatQuotaExhaustedBanner
|
||||
title={messageLimitTitle}
|
||||
|
||||
Reference in New Issue
Block a user