feat(chat): add promotional external entry flow
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { PayChannel } from "@/data/dto/payment";
|
||||
import type {
|
||||
PendingChatUnlockKind,
|
||||
PendingChatPromotion,
|
||||
PendingChatUnlockStage,
|
||||
} from "@/data/storage/navigation";
|
||||
|
||||
@@ -15,16 +16,24 @@ export interface OpenSubscriptionInput {
|
||||
}
|
||||
|
||||
export interface StartMessageUnlockInput {
|
||||
messageId: string;
|
||||
displayMessageId: string;
|
||||
messageId?: string;
|
||||
kind: PendingChatUnlockKind;
|
||||
lockType?: PendingChatPromotion["lockType"];
|
||||
clientLockId?: string;
|
||||
promotion?: PendingChatPromotion;
|
||||
returnUrl: string;
|
||||
stage?: PendingChatUnlockStage;
|
||||
onAuthenticated: () => void;
|
||||
}
|
||||
|
||||
export interface OpenSubscriptionForPendingUnlockInput {
|
||||
messageId: string;
|
||||
displayMessageId: string;
|
||||
messageId?: string;
|
||||
kind: PendingChatUnlockKind;
|
||||
lockType?: PendingChatPromotion["lockType"];
|
||||
clientLockId?: string;
|
||||
promotion?: PendingChatPromotion;
|
||||
returnUrl: string;
|
||||
type: AppSubscriptionType;
|
||||
payChannel?: PayChannel;
|
||||
|
||||
@@ -108,8 +108,12 @@ export function useAppNavigator(): AppNavigator {
|
||||
|
||||
const startMessageUnlock = useCallback(
|
||||
({
|
||||
displayMessageId,
|
||||
messageId,
|
||||
kind,
|
||||
lockType,
|
||||
clientLockId,
|
||||
promotion,
|
||||
returnUrl,
|
||||
stage = "auth",
|
||||
onAuthenticated,
|
||||
@@ -121,8 +125,12 @@ export function useAppNavigator(): AppNavigator {
|
||||
|
||||
void (async () => {
|
||||
await NavigationStorage.savePendingChatUnlock({
|
||||
displayMessageId,
|
||||
messageId,
|
||||
kind,
|
||||
lockType,
|
||||
clientLockId,
|
||||
promotion,
|
||||
returnUrl,
|
||||
stage,
|
||||
});
|
||||
@@ -134,16 +142,24 @@ export function useAppNavigator(): AppNavigator {
|
||||
|
||||
const openSubscriptionForPendingUnlock = useCallback(
|
||||
({
|
||||
displayMessageId,
|
||||
messageId,
|
||||
kind,
|
||||
lockType,
|
||||
clientLockId,
|
||||
promotion,
|
||||
returnUrl,
|
||||
type,
|
||||
payChannel = getDefaultPayChannel(),
|
||||
}: OpenSubscriptionForPendingUnlockInput): void => {
|
||||
void (async () => {
|
||||
await NavigationStorage.savePendingChatUnlock({
|
||||
displayMessageId,
|
||||
messageId,
|
||||
kind,
|
||||
lockType,
|
||||
clientLockId,
|
||||
promotion,
|
||||
returnUrl,
|
||||
stage: "payment",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user