Skip to content

Commit

Permalink
Show correct base asset in Decrypt Request view
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanml committed Sep 20, 2022
1 parent 8fcdea7 commit 1875bc5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default class ConfirmDecryptMessage extends Component {
requesterAddress: PropTypes.string,
txData: PropTypes.object,
subjectMetadata: PropTypes.object,
nativeCurrency: PropTypes.string.isRequired,
};

state = {
Expand Down Expand Up @@ -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',
Expand All @@ -111,7 +112,7 @@ export default class ConfirmDecryptMessage extends Component {
{`${t('balance')}:`}
</div>
<div className="request-decrypt-message__balance-value">
{`${balanceInEther} ETH`}
{`${nativeCurrencyBalance} ${nativeCurrency}`}
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -40,6 +41,7 @@ function mapStateToProps(state) {
requesterAddress: null,
conversionRate: conversionRateSelector(state),
mostRecentOverviewPage: getMostRecentOverviewPage(state),
nativeCurrency: getNativeCurrency(state),
};
}

Expand Down

0 comments on commit 1875bc5

Please sign in to comment.