refactor(storage): use unstorage for session state
This commit is contained in:
@@ -27,9 +27,19 @@ export function PaymentSuccessSync() {
|
||||
if (lastPaidKeyRef.current === paidKey) return;
|
||||
lastPaidKeyRef.current = paidKey;
|
||||
|
||||
userDispatch({ type: "UserFetch" });
|
||||
if (hasPendingChatUnlock()) return;
|
||||
chatDispatch({ type: "ChatPaymentSucceeded" });
|
||||
let cancelled = false;
|
||||
|
||||
const syncPaymentSuccess = async () => {
|
||||
userDispatch({ type: "UserFetch" });
|
||||
if (await hasPendingChatUnlock()) return;
|
||||
if (cancelled) return;
|
||||
chatDispatch({ type: "ChatPaymentSucceeded" });
|
||||
};
|
||||
|
||||
void syncPaymentSuccess();
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, [
|
||||
chatDispatch,
|
||||
paymentState.currentOrderId,
|
||||
|
||||
Reference in New Issue
Block a user