feat(chat): unlock paid messages before payment

This commit is contained in:
2026-06-30 18:56:17 +08:00
parent 5f94105bc6
commit e7a9e7abe5
21 changed files with 774 additions and 31 deletions
@@ -11,6 +11,7 @@ import { useEffect, useRef } from "react";
import { useChatDispatch } from "@/stores/chat/chat-context";
import { useUserDispatch } from "@/stores/user/user-context";
import { hasPendingChatUnlock } from "@/lib/navigation/chat_unlock_session";
import { usePaymentState } from "./payment-context";
@@ -28,6 +29,7 @@ export function PaymentSuccessSync() {
lastPaidKeyRef.current = paidKey;
userDispatch({ type: "UserFetch" });
if (hasPendingChatUnlock()) return;
chatDispatch({ type: "ChatPaymentSucceeded" });
}, [
chatDispatch,