From 1875bc5a0bb44fe70b49ed27b6d5e2e95e92f1b5 Mon Sep 17 00:00:00 2001 From: ryanml Date: Mon, 19 Sep 2022 22:41:33 -0700 Subject: [PATCH] Show correct base asset in Decrypt Request view --- .../confirm-decrypt-message.component.js | 7 ++++--- .../confirm-decrypt-message.container.js | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ui/pages/confirm-decrypt-message/confirm-decrypt-message.component.js b/ui/pages/confirm-decrypt-message/confirm-decrypt-message.component.js index 336278261dff..71c1585724f4 100644 --- a/ui/pages/confirm-decrypt-message/confirm-decrypt-message.component.js +++ b/ui/pages/confirm-decrypt-message/confirm-decrypt-message.component.js @@ -35,6 +35,7 @@ export default class ConfirmDecryptMessage extends Component { requesterAddress: PropTypes.string, txData: PropTypes.object, subjectMetadata: PropTypes.object, + nativeCurrency: PropTypes.string.isRequired, }; state = { @@ -91,13 +92,13 @@ export default class ConfirmDecryptMessage extends Component { }; renderBalance = () => { - const { conversionRate } = this.props; + const { conversionRate, nativeCurrency } = this.props; const { fromAccount: { balance }, } = this.state; const { t } = this.context; - const balanceInEther = conversionUtil(balance, { + const nativeCurrencyBalance = conversionUtil(balance, { fromNumericBase: 'hex', toNumericBase: 'dec', fromDenomination: 'WEI', @@ -111,7 +112,7 @@ export default class ConfirmDecryptMessage extends Component { {`${t('balance')}:`}
- {`${balanceInEther} ETH`} + {`${nativeCurrencyBalance} ${nativeCurrency}`}
); diff --git a/ui/pages/confirm-decrypt-message/confirm-decrypt-message.container.js b/ui/pages/confirm-decrypt-message/confirm-decrypt-message.container.js index 541a8fb19cff..cdc56ed5bbc0 100644 --- a/ui/pages/confirm-decrypt-message/confirm-decrypt-message.container.js +++ b/ui/pages/confirm-decrypt-message/confirm-decrypt-message.container.js @@ -15,6 +15,7 @@ import { } from '../../selectors'; import { clearConfirmTransaction } from '../../ducks/confirm-transaction/confirm-transaction.duck'; import { getMostRecentOverviewPage } from '../../ducks/history/history'; +import { getNativeCurrency } from '../../ducks/metamask/metamask'; import ConfirmDecryptMessage from './confirm-decrypt-message.component'; function mapStateToProps(state) { @@ -40,6 +41,7 @@ function mapStateToProps(state) { requesterAddress: null, conversionRate: conversionRateSelector(state), mostRecentOverviewPage: getMostRecentOverviewPage(state), + nativeCurrency: getNativeCurrency(state), }; }