feat(chat): add support action cards and live entitlements
Docker Image / Build and Push Docker Image (push) Successful in 2m2s
Docker Image / Build and Push Docker Image (push) Successful in 2m2s
This commit is contained in:
@@ -23,6 +23,8 @@ export interface UsePaymentRouteFlowInput {
|
||||
initialCategory?: string | null;
|
||||
initialPlanId?: string | null;
|
||||
commercialOfferId?: string | null;
|
||||
resumeOrderId?: string | null;
|
||||
chatActionId?: string | null;
|
||||
}
|
||||
|
||||
export interface PaymentRouteFlow {
|
||||
@@ -43,16 +45,20 @@ export function usePaymentRouteFlow({
|
||||
initialCategory = null,
|
||||
initialPlanId = null,
|
||||
commercialOfferId = null,
|
||||
resumeOrderId = null,
|
||||
chatActionId = null,
|
||||
}: UsePaymentRouteFlowInput): PaymentRouteFlow {
|
||||
const payment = usePaymentState();
|
||||
const paymentDispatch = usePaymentDispatch();
|
||||
const initializedCatalogKeyRef = useRef<string | null>(null);
|
||||
const resumedOrderIdRef = useRef<string | null>(null);
|
||||
const catalogKey = [
|
||||
catalog,
|
||||
characterId ?? "",
|
||||
initialCategory ?? "",
|
||||
initialPlanId ?? "",
|
||||
commercialOfferId ?? "",
|
||||
chatActionId ?? "",
|
||||
].join(":");
|
||||
|
||||
usePendingPaymentOrderLifecycle({
|
||||
@@ -73,17 +79,25 @@ export function usePaymentRouteFlow({
|
||||
...(initialCategory ? { category: initialCategory } : {}),
|
||||
...(initialPlanId ? { planId: initialPlanId } : {}),
|
||||
...(commercialOfferId ? { commercialOfferId } : {}),
|
||||
...(chatActionId ? { chatActionId } : {}),
|
||||
});
|
||||
}, [
|
||||
catalog,
|
||||
catalogKey,
|
||||
characterId,
|
||||
commercialOfferId,
|
||||
chatActionId,
|
||||
initialCategory,
|
||||
initialPlanId,
|
||||
initialPayChannel,
|
||||
paymentDispatch,
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!resumeOrderId || resumedOrderIdRef.current === resumeOrderId) return;
|
||||
resumedOrderIdRef.current = resumeOrderId;
|
||||
paymentDispatch({ type: "PaymentReturned", orderId: resumeOrderId });
|
||||
}, [paymentDispatch, resumeOrderId]);
|
||||
|
||||
return { payment, paymentDispatch };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user