From 9ed9fd1a4493e8afe409373eff72a6edfa926e3d Mon Sep 17 00:00:00 2001 From: Kurdistan Tech Ministry Date: Mon, 23 Feb 2026 22:32:58 +0300 Subject: [PATCH] fix: withdrawal end-to-end flow and UI improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- web/src/components/p2p/WithdrawModal.tsx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/web/src/components/p2p/WithdrawModal.tsx b/web/src/components/p2p/WithdrawModal.tsx index e4c9d68e..e4723c7b 100644 --- a/web/src/components/p2p/WithdrawModal.tsx +++ b/web/src/components/p2p/WithdrawModal.tsx @@ -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 )} - {/* Pending Requests Warning */} + {/* Pending Requests Info */} {pendingRequests.length > 0 && ( - - + + {t('p2pWithdraw.pendingWarning', { count: pendingRequests.length })}