refactor(storage): use unstorage for session state

This commit is contained in:
2026-07-01 18:36:26 +08:00
parent 0251916a8a
commit ae6578923b
13 changed files with 398 additions and 246 deletions
+13 -3
View File
@@ -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,