-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Remove useArbTokenBridge from store 3/3 #2090
base: fs-1001/add-usecallbacks
Are you sure you want to change the base?
refactor: Remove useArbTokenBridge from store 3/3 #2090
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
f1be4ee
to
3e54561
Compare
c72b3a9
to
5789015
Compare
useEffect(() => { | ||
if (!nativeCurrency.isCustom) { | ||
return | ||
} | ||
|
||
const selectedTokenAddress = selectedToken?.address.toLowerCase() | ||
const selectedTokenL2Address = selectedToken?.l2Address?.toLowerCase() | ||
// This handles a super weird edge case where, for example: | ||
// | ||
// Your setup is: from Arbitrum One to Mainnet, and you have $ARB selected as the token you want to bridge over. | ||
// You then switch your destination network to a network that has $ARB as its native currency. | ||
// For this network, $ARB can only be bridged as the native currency, and not as a standard ERC-20, which is why we have to reset the selected token. | ||
if ( | ||
selectedTokenAddress === nativeCurrency.address || | ||
selectedTokenL2Address === nativeCurrency.address | ||
) { | ||
actions.app.setSelectedToken(null) | ||
} | ||
}, [selectedToken, nativeCurrency]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, tested with APE token for Ape chain and it works well after deletion
if (selectedToken) { | ||
updateTokenData(selectedToken.address) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing updateUSDCBalances()
from BalanceUpdater
and so USDC doesn't get updated, e.g. native USDC on Arb Sepolia
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed back here aa3d8fc
(#2090)
5789015
to
94da1e5
Compare
3e54561
to
f5b2dad
Compare
f5b2dad
to
bdd3de5
Compare
a376a1a
to
718b487
Compare
aa3d8fc
to
29ed1d6
Compare
Summary
Replace useAppState calls with useArbTokenBridge
Steps to test