feat(chat): restore image viewer after payment
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user