-
Notifications
You must be signed in to change notification settings - Fork 48
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
[Fix] incorrect network info on NFT sends + L2 explainer sheet #1804
[Fix] incorrect network info on NFT sends + L2 explainer sheet #1804
Conversation
This reverts commit 8ba3cb1.
showExplainerSheet({ | ||
...getSideChainExplainerParams(asset.chainId, hideExplainerSheet), | ||
...getSideChainExplainerParams(chain?.id as ChainId, hideExplainerSheet), |
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.
this doesn't need to be optionally chained if you're null checking beforehand. Also, any way to avoid having to cast as ChainId
? I kinda hate this pattern of casting number
-> ChainId
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.
yes. will fix this up later today.
@BrodyHughes Not familiar with the upstream queries, but I wonder if we can also deprecate the |
Yo lemme know if i am misunderstanding but i checked the upstream code and saw that we're already handling the chain conversion in simpleHashNFTToUniqueAsset where the NFT data is first processed. The chain?.id undefined check is happening separately in the UI layer, so removing the mainnet fallback wouldn't solve our current type issue i dont think |
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.
Tested NFT and ERC20 send reviews on Mainnet and Base
Fixes BX-1688
What changed (plus any additional context for devs)
We had user reports that NFT sends on base in the BX are showing the wrong network message during the send process. I could reproduce this behavior. We were just defaulting to mainnet because our current logic was relying on
asset.chainId
which was returningundefined
. this is expected behavior because our NFT data comes fromnft
notasset
The fix was to instead use our more broad chain info found in our
chain
object. This is defined as:Using the
chain
object for chain related info returns the correct data for both token AND nft sends as you can see in my POW.Another bug i fixed here was related to L2 explainers. The same issue we had with the above info was making L2 explainers not show at all on NFT sends, so I moved that logic over to
chain
as well for its info.Screen recordings / screenshots
POW:
Screen.Recording.2025-01-14.at.2.47.16.PM.mov
What to test
Do sends of NFT and tokens on L2 networks and make sure the review sheet shows the correct info.