mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-22 05:37:56 +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');
|
||||
}
|
||||
|
||||
// Check for pending requests
|
||||
const hasPendingForToken = pendingRequests.some(r => r.token === token);
|
||||
if (hasPendingForToken) {
|
||||
return t('p2pWithdraw.pendingForToken', { token });
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
@@ -291,10 +285,10 @@ export function WithdrawModal({ isOpen, onClose, onSuccess }: WithdrawModalProps
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
{/* Pending Requests Warning */}
|
||||
{/* Pending Requests Info */}
|
||||
{pendingRequests.length > 0 && (
|
||||
<Alert variant="destructive">
|
||||
<AlertTriangle className="h-4 w-4" />
|
||||
<Alert>
|
||||
<Info className="h-4 w-4" />
|
||||
<AlertDescription>
|
||||
{t('p2pWithdraw.pendingWarning', { count: pendingRequests.length })}
|
||||
</AlertDescription>
|
||||
|
||||
Reference in New Issue
Block a user