diff --git a/src-gui/src/renderer/components/modal/wallet/WithdrawDialog.tsx b/src-gui/src/renderer/components/modal/wallet/WithdrawDialog.tsx index 4ff1cbbd..317e644d 100644 --- a/src-gui/src/renderer/components/modal/wallet/WithdrawDialog.tsx +++ b/src-gui/src/renderer/components/modal/wallet/WithdrawDialog.tsx @@ -19,6 +19,8 @@ export default function WithdrawDialog({ const [withdrawAddressValid, setWithdrawAddressValid] = useState(false); const [withdrawAddress, setWithdrawAddress] = useState(""); + const haveFundsBeenWithdrawn = withdrawTxId !== null; + function onCancel() { if (!pending) { setWithdrawTxId(null); @@ -31,34 +33,34 @@ export default function WithdrawDialog({ - {withdrawTxId === null ? ( + {haveFundsBeenWithdrawn ? ( + + ) : ( - ) : ( - )} - - {withdrawTxId === null && ( + {!haveFundsBeenWithdrawn && ( withdrawBtc(withdrawAddress)} - onPendingChange={(pending) => { - console.log("pending", pending); - setPending(pending); - }} - onSuccess={(txId) => { - setWithdrawTxId(txId); - }} + onPendingChange={setPending} + onSuccess={setWithdrawTxId} > Withdraw