feat(chat): add promotional external entry flow
This commit is contained in:
@@ -4,18 +4,26 @@ import {
|
||||
NavigationStorage,
|
||||
type PendingChatUnlock,
|
||||
type PendingChatUnlockKind,
|
||||
type PendingChatPromotion,
|
||||
type PendingChatPromotionType,
|
||||
type PendingChatUnlockStage,
|
||||
} from "@/data/storage/navigation";
|
||||
|
||||
export type {
|
||||
PendingChatUnlock,
|
||||
PendingChatUnlockKind,
|
||||
PendingChatPromotion,
|
||||
PendingChatPromotionType,
|
||||
PendingChatUnlockStage,
|
||||
};
|
||||
|
||||
export async function savePendingChatUnlock(input: {
|
||||
messageId: string;
|
||||
displayMessageId?: string;
|
||||
messageId?: string;
|
||||
kind: PendingChatUnlockKind;
|
||||
lockType?: PendingChatUnlock["lockType"];
|
||||
clientLockId?: string;
|
||||
promotion?: PendingChatPromotion;
|
||||
returnUrl: string;
|
||||
stage: PendingChatUnlockStage;
|
||||
}): Promise<void> {
|
||||
@@ -37,3 +45,17 @@ export async function hasPendingChatUnlock(): Promise<boolean> {
|
||||
export async function clearPendingChatUnlock(): Promise<void> {
|
||||
await NavigationStorage.clearPendingChatUnlock();
|
||||
}
|
||||
|
||||
export async function savePendingChatPromotion(
|
||||
promotionType: PendingChatPromotionType,
|
||||
): Promise<PendingChatPromotion> {
|
||||
return NavigationStorage.savePendingChatPromotion(promotionType);
|
||||
}
|
||||
|
||||
export async function consumePendingChatPromotion(): Promise<PendingChatPromotion | null> {
|
||||
return NavigationStorage.consumePendingChatPromotion();
|
||||
}
|
||||
|
||||
export async function clearPendingChatPromotion(): Promise<void> {
|
||||
await NavigationStorage.clearPendingChatPromotion();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user