Skip to content

Commit

Permalink
fix: fix asset symbol for incoming tx (#11495)
Browse files Browse the repository at this point in the history
## **Description**

This PR fixes the assets symbol displayed in the incoming transaction
notification.

## **Related issues**

Fixes: #7669

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

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

### **Before**

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

### **After**

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

## **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 Oct 9, 2024
1 parent 305f930 commit f35f102
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/core/NotificationManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ import {

import { safeToChecksumAddress } from '../util/address';
import ReviewManager from './ReviewManager';
import { selectChainId } from '../selectors/networkController';
import { selectChainId, selectTicker } from '../selectors/networkController';
import { store } from '../store';
import { useSelector } from 'react-redux';
import { getTicker } from '../../app/util/transactions';
export const constructTitleAndMessage = (notification) => {
let title, message;
switch (notification.type) {
Expand Down Expand Up @@ -412,6 +414,7 @@ class NotificationManager {
);

const chainId = selectChainId(store.getState());
const ticker = useSelector(selectTicker);

/// Find the incoming TX
const transactions = TransactionController.getTransactions({
Expand Down Expand Up @@ -442,7 +445,7 @@ class NotificationManager {
nonce: `${hexToBN(txs[0].txParams.nonce).toString()}`,
amount: `${renderFromWei(hexToBN(txs[0].txParams.value))}`,
id: txs[0]?.id,
assetType: strings('unit.eth'),
assetType: getTicker(ticker),
},
autoHide: true,
duration: 7000,
Expand Down

0 comments on commit f35f102

Please sign in to comment.