Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions components/sections/bridge/tofield.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? "");
}
Comment on lines +20 to 22
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Missing fromChain in dependencies array. The toAddress should be reset when fromChain changes since it affects the wallet connection requirements.

}, [connected, selected, toChain]);
Comment on lines 16 to 23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Missing setToAddress in useEffect dependencies array. Could cause stale closure issues if setToAddress changes.


Expand Down