Skip to content

Commit

Permalink
fix: fix token details navigation (#12659)
Browse files Browse the repository at this point in the history
## **Description**

PR to fix app crash when user navigates to token details page.

## **Related issues**

Fixes: #12660

## **Manual testing steps**

1. Click on any asset in your wallet
2. Click on options (3 dots) top right
3. Click on Token Details
4. You should see token details without an app crash


## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->


https://github.com/user-attachments/assets/e5b53a50-8294-4b63-80ff-41cfe9fb45e2




## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
  • Loading branch information
sahar-fehri authored Dec 12, 2024
1 parent 7e40e3e commit 7e52ed6
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions app/components/Views/AssetOptions/AssetOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,17 @@ const AssetOptions = (props: Props) => {
networkConfigurations[networkId as Hex]?.rpcEndpoints?.[
networkConfigurations[networkId as Hex]?.defaultRpcEndpointIndex
];
let providerConfigToken;
if (isPortfolioViewEnabled()) {
providerConfigToken = createProviderConfig(
tokenNetworkConfig,
tokenRpcEndpoint,
);
} else {
providerConfigToken = providerConfig;
}

const providerConfigToken = createProviderConfig(
tokenNetworkConfig,
tokenRpcEndpoint,
);

const providerConfigTokenExplorerToken = isPortfolioViewEnabled()
? providerConfigToken
: providerConfig;
const providerConfigTokenExplorerToken = providerConfigToken;

return {
providerConfigTokenExplorer: providerConfigTokenExplorerToken,
Expand Down

0 comments on commit 7e52ed6

Please sign in to comment.