feat(chat): restore image viewer after payment

This commit is contained in:
2026-06-29 16:19:48 +08:00
parent 6273cd1bbe
commit 61796c732f
12 changed files with 297 additions and 63 deletions
+7 -5
View File
@@ -8,6 +8,7 @@ import { useAuthState } from "@/stores/auth/auth-context";
import { useChatDispatch, useChatState } from "@/stores/chat/chat-context";
import { MobileShell } from "@/app/_components/core";
import { consumePendingChatImageReturn } from "./chat-image-return-session";
import {
BrowserHintOverlay,
@@ -88,6 +89,12 @@ export function ChatScreen() {
authState.loginStatus,
]);
useEffect(() => {
const pendingImageReturn = consumePendingChatImageReturn();
if (!pendingImageReturn) return;
router.replace(pendingImageReturn.returnUrl);
}, [router]);
async function handleOpenExternalBrowser(): Promise<void> {
setShowExternalBrowserDialog(false);
await openChatInExternalBrowser();
@@ -101,10 +108,6 @@ export function ChatScreen() {
openChatPaywallSubscription();
}
function handleUnlockImagePaywall(): void {
openChatPaywallSubscription();
}
function handleMessageLimitUnlock(): void {
openChatPaywallSubscription();
}
@@ -135,7 +138,6 @@ export function ChatScreen() {
isReplyingAI={state.isReplyingAI}
isGuest={isGuest}
onUnlockPrivateMessage={handleUnlockPrivateMessage}
onUnlockImagePaywall={handleUnlockImagePaywall}
onUnlockVoiceMessage={handleUnlockVoiceMessage}
/>