Skip to content

Commit

Permalink
refactor: reset selected account on account change (#1226)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjeatt authored May 24, 2023
1 parent c000243 commit 17251a3
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,14 @@ const CrossChainTransferForm = (): JSX.Element => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [accountId, destinationChains]);

// TODO: When we refactor account select this should be handled there so
// that it's consitent across the application
useEffect(() => {
if (!accountId) return;
form.setFieldValue(CROSS_CHAIN_TRANSFER_TO_ACCOUNT_FIELD, accountId?.toString());
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [accountId]);

if (!originatingChains || !destinationChains || !transferableTokens.length) {
return (
<Flex justifyContent='center'>
Expand Down

2 comments on commit 17251a3

@vercel
Copy link

@vercel vercel bot commented on 17251a3 May 24, 2023

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on 17251a3 May 24, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.