fix(chat): isolate pending flows and cancel stale requests
This commit is contained in:
@@ -18,6 +18,7 @@ export type {
|
||||
};
|
||||
|
||||
export async function savePendingChatUnlock(input: {
|
||||
characterId: string;
|
||||
displayMessageId?: string;
|
||||
messageId?: string;
|
||||
kind: PendingChatUnlockKind;
|
||||
@@ -30,16 +31,20 @@ export async function savePendingChatUnlock(input: {
|
||||
await NavigationStorage.savePendingChatUnlock(input);
|
||||
}
|
||||
|
||||
export async function consumePendingChatUnlock(): Promise<PendingChatUnlock | null> {
|
||||
return NavigationStorage.consumePendingChatUnlock();
|
||||
export async function consumePendingChatUnlock(
|
||||
characterId: string,
|
||||
): Promise<PendingChatUnlock | null> {
|
||||
return NavigationStorage.consumePendingChatUnlock(characterId);
|
||||
}
|
||||
|
||||
export async function peekPendingChatUnlock(): Promise<PendingChatUnlock | null> {
|
||||
return NavigationStorage.peekPendingChatUnlock();
|
||||
export async function peekPendingChatUnlock(
|
||||
characterId: string,
|
||||
): Promise<PendingChatUnlock | null> {
|
||||
return NavigationStorage.peekPendingChatUnlock(characterId);
|
||||
}
|
||||
|
||||
export async function hasPendingChatUnlock(): Promise<boolean> {
|
||||
return NavigationStorage.hasPendingChatUnlock();
|
||||
export async function hasPendingChatUnlock(characterId: string): Promise<boolean> {
|
||||
return NavigationStorage.hasPendingChatUnlock(characterId);
|
||||
}
|
||||
|
||||
export async function clearPendingChatUnlock(): Promise<void> {
|
||||
@@ -48,12 +53,15 @@ export async function clearPendingChatUnlock(): Promise<void> {
|
||||
|
||||
export async function savePendingChatPromotion(
|
||||
promotionType: PendingChatPromotionType,
|
||||
characterId: string,
|
||||
): Promise<PendingChatPromotion> {
|
||||
return NavigationStorage.savePendingChatPromotion(promotionType);
|
||||
return NavigationStorage.savePendingChatPromotion(promotionType, characterId);
|
||||
}
|
||||
|
||||
export async function consumePendingChatPromotion(): Promise<PendingChatPromotion | null> {
|
||||
return NavigationStorage.consumePendingChatPromotion();
|
||||
export async function consumePendingChatPromotion(
|
||||
characterId: string,
|
||||
): Promise<PendingChatPromotion | null> {
|
||||
return NavigationStorage.consumePendingChatPromotion(characterId);
|
||||
}
|
||||
|
||||
export async function clearPendingChatPromotion(): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user