feat(chat): unlock paid messages before payment
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user