From 3feb4b732fe61c1a2ed9ca8f9c9102121f0c84c4 Mon Sep 17 00:00:00 2001 From: mizanxali Date: Mon, 20 Jan 2025 23:39:08 +0530 Subject: [PATCH] fix: toField misbehaving when swap button clicked with one wallet connected --- components/sections/bridge/tofield.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/sections/bridge/tofield.tsx b/components/sections/bridge/tofield.tsx index f6524af..2ce3d0c 100644 --- a/components/sections/bridge/tofield.tsx +++ b/components/sections/bridge/tofield.tsx @@ -14,11 +14,11 @@ export default function ToField() { const { selected } = useAvailAccount(); useEffect(() => { - if (toChain === Chain.AVAIL && selected) { - setToAddress(selected.address); + if (toChain === Chain.AVAIL) { + setToAddress(selected ? selected.address : ""); } - if ((toChain === Chain.BASE || toChain === Chain.ETH) && ethAddress) { - setToAddress(ethAddress); + if ((toChain === Chain.BASE || toChain === Chain.ETH)) { + setToAddress(ethAddress ?? ""); } }, [connected, selected, toChain]);