Mayank/feat/rain va - #2092
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
🟠
|
| Entry | Sets kycFlow? |
|---|---|
hooks/useCardSteps/useCardSteps.ts:123/128 (Rain card) |
✅ 'card' |
components/DepositOption/VirtualAccountDetails/VirtualAccountApplyModal.tsx:34 (VA) |
✅ 'va' |
app/(protected)/(tabs)/user-kyc-info.tsx:42 (Rain redirect) |
❌ leaves it stale |
Because Didit KYC is shared between the VA and card flows, a stale 'va' can break the existing card flow:
- User opens VA → completes Didit →
kycFlow = 'va'(sticky, never cleared). - That same KYC approval also satisfies the card, so a later card attempt may skip
useCardSteps'setKycFlow('card'). - On
/card/pending,if (kycFlow === 'va') return;(app/(protected)/(tabs)/card/pending.tsx:25) short-circuits the entire auto-routing — no redirect toCARD_READY/CARD_DETAILS/CARD_ACTIVATE. The 5s poll never advances them, so they're stuck on "Thank you for your submission!" even after the card is ready.
The same stale flag makes components/kyc/useDiditSession.ts:77 force CARD_PENDING instead of the correct card destination.
Suggested fix: clear/normalize kycFlow at the start of the card flow (or on card-pending mount), set it on the user-kyc-info redirect, and/or call clearKycFlow() once it's been consumed. Alternatively, scope the 'va' early-return to "no card yet" so it can't strand users who already have a card.
Generated by Claude Code
No description provided.