mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-06-14 20:41:02 +00:00
fix: withdrawal end-to-end flow and UI improvements
- requestWithdraw() calls process-withdraw edge function for full flow (lock balance + blockchain TX + complete) instead of just DB lock - Remove pending request block from withdrawal validation — backend already enforces available_balance with FOR UPDATE row lock - Pending requests shown as info alert instead of blocking error - Balance card: numbers right-aligned, 2 decimal places
This commit is contained in:
@@ -154,12 +154,6 @@ export function WithdrawModal({ isOpen, onClose, onSuccess }: WithdrawModalProps
|
|||||||
return t('p2pWithdraw.invalidAddress');
|
return t('p2pWithdraw.invalidAddress');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for pending requests
|
|
||||||
const hasPendingForToken = pendingRequests.some(r => r.token === token);
|
|
||||||
if (hasPendingForToken) {
|
|
||||||
return t('p2pWithdraw.pendingForToken', { token });
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -291,10 +285,10 @@ export function WithdrawModal({ isOpen, onClose, onSuccess }: WithdrawModalProps
|
|||||||
</Alert>
|
</Alert>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Pending Requests Warning */}
|
{/* Pending Requests Info */}
|
||||||
{pendingRequests.length > 0 && (
|
{pendingRequests.length > 0 && (
|
||||||
<Alert variant="destructive">
|
<Alert>
|
||||||
<AlertTriangle className="h-4 w-4" />
|
<Info className="h-4 w-4" />
|
||||||
<AlertDescription>
|
<AlertDescription>
|
||||||
{t('p2pWithdraw.pendingWarning', { count: pendingRequests.length })}
|
{t('p2pWithdraw.pendingWarning', { count: pendingRequests.length })}
|
||||||
</AlertDescription>
|
</AlertDescription>
|
||||||
|
|||||||
Reference in New Issue
Block a user