Skip to content
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

Open
wants to merge 5 commits into
base: fs-1001/add-usecallbacks
Choose a base branch
from

Conversation

chrstph-dvx
Copy link
Contributor

Summary

Replace useAppState calls with useArbTokenBridge

Steps to test

@chrstph-dvx chrstph-dvx self-assigned this Nov 19, 2024
Copy link

vercel bot commented Nov 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
arbitrum-token-bridge ✅ Ready (Inspect) Visit Preview Dec 9, 2024 6:34pm

@cla-bot cla-bot bot added the cla-signed label Nov 19, 2024
@chrstph-dvx chrstph-dvx changed the title refactor: Simplify syncers refactor: Remove useArbTokenBridge from store 3/3 Nov 19, 2024
@chrstph-dvx chrstph-dvx force-pushed the fs-1001/replace-useAppState-calls branch from f1be4ee to 3e54561 Compare November 19, 2024 20:14
@chrstph-dvx chrstph-dvx force-pushed the fs-1001/add-usecallbacks branch from c72b3a9 to 5789015 Compare November 19, 2024 20:15
@chrstph-dvx chrstph-dvx changed the base branch from fs-1001/add-usecallbacks to master November 19, 2024 20:15
@chrstph-dvx chrstph-dvx changed the base branch from master to fs-1001/add-usecallbacks November 19, 2024 20:16
Comment on lines -77 to -95
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])
Copy link
Member

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

Comment on lines +86 to +93
if (selectedToken) {
updateTokenData(selectedToken.address)
}
Copy link
Member

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

Copy link
Contributor Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants