feat(chat): add promotional external entry flow

This commit is contained in:
2026-07-13 12:43:18 +08:00
parent e5ee9940ca
commit 3752b3b729
44 changed files with 1623 additions and 190 deletions
+11 -2
View File
@@ -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;
+16
View File
@@ -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",
});