-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: fix error when navigating to asset details on bridge #15409
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
base: main
Are you sure you want to change the base?
fix: fix error when navigating to asset details on bridge #15409
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
@@ -83,7 +83,7 @@ const Price = ({ | |||
|
|||
const price: number = isEvmNetworkSelected | |||
? distributedPriceData[activeChartIndex]?.[1] || currentPrice | |||
: Number(multichainAssetRates.rate); | |||
: Number(multichainAssetRates?.rate); |
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.
Could this potentially resolve as NaN
?
|
@@ -91,11 +92,15 @@ const AssetOverview: React.FC<AssetOverviewProps> = ({ | |||
swapsIsLive, | |||
networkName, | |||
}: AssetOverviewProps) => { | |||
// For non evm assets, the resultChainId is equal to the asset.chainId; while for evm assets; the resultChainId === "eip155:1" !== asset.chainId | |||
const resultChainId = formatChainIdToCaip(asset.chainId as Hex); | |||
const isNonEvmAsset = resultChainId === asset.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.
Couple components were fetching data from EVM vs Non EVM selectors based on isEvmSelected
Which would work correctly if you are initially on an EVM or non EVM network initially, and then click on one of the assets from the main tokenList.
While in the bridge flow; you can initially be on a NonEVM network; then choose to bridge to an EVM network and naviagate to token details page for an EVM asset. Which meant that relying on "isEvmSelected" is no longer accurate to fetch correct data from correct selectors; hence; changed this to rely on whether the asset that is being clicked on is EVM or non EVM
Description
Related issues
Fixes: #15407
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist