refactor(chat): remove private unlock machine flow

This commit is contained in:
2026-06-26 19:17:29 +08:00
parent b6f18a1ef3
commit 1b73c3ac10
11 changed files with 27 additions and 302 deletions
+8 -30
View File
@@ -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}