mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +01:00
Show correct base asset in Decrypt Request view (#15885)
This commit is contained in:
parent
e69e207b7d
commit
e422c6b09b
@ -35,6 +35,7 @@ export default class ConfirmDecryptMessage extends Component {
|
|||||||
requesterAddress: PropTypes.string,
|
requesterAddress: PropTypes.string,
|
||||||
txData: PropTypes.object,
|
txData: PropTypes.object,
|
||||||
subjectMetadata: PropTypes.object,
|
subjectMetadata: PropTypes.object,
|
||||||
|
nativeCurrency: PropTypes.string.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@ -91,13 +92,13 @@ export default class ConfirmDecryptMessage extends Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
renderBalance = () => {
|
renderBalance = () => {
|
||||||
const { conversionRate } = this.props;
|
const { conversionRate, nativeCurrency } = this.props;
|
||||||
const {
|
const {
|
||||||
fromAccount: { balance },
|
fromAccount: { balance },
|
||||||
} = this.state;
|
} = this.state;
|
||||||
const { t } = this.context;
|
const { t } = this.context;
|
||||||
|
|
||||||
const balanceInEther = conversionUtil(balance, {
|
const nativeCurrencyBalance = conversionUtil(balance, {
|
||||||
fromNumericBase: 'hex',
|
fromNumericBase: 'hex',
|
||||||
toNumericBase: 'dec',
|
toNumericBase: 'dec',
|
||||||
fromDenomination: 'WEI',
|
fromDenomination: 'WEI',
|
||||||
@ -111,7 +112,7 @@ export default class ConfirmDecryptMessage extends Component {
|
|||||||
{`${t('balance')}:`}
|
{`${t('balance')}:`}
|
||||||
</div>
|
</div>
|
||||||
<div className="request-decrypt-message__balance-value">
|
<div className="request-decrypt-message__balance-value">
|
||||||
{`${balanceInEther} ETH`}
|
{`${nativeCurrencyBalance} ${nativeCurrency}`}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -15,6 +15,7 @@ import {
|
|||||||
} from '../../selectors';
|
} from '../../selectors';
|
||||||
import { clearConfirmTransaction } from '../../ducks/confirm-transaction/confirm-transaction.duck';
|
import { clearConfirmTransaction } from '../../ducks/confirm-transaction/confirm-transaction.duck';
|
||||||
import { getMostRecentOverviewPage } from '../../ducks/history/history';
|
import { getMostRecentOverviewPage } from '../../ducks/history/history';
|
||||||
|
import { getNativeCurrency } from '../../ducks/metamask/metamask';
|
||||||
import ConfirmDecryptMessage from './confirm-decrypt-message.component';
|
import ConfirmDecryptMessage from './confirm-decrypt-message.component';
|
||||||
|
|
||||||
function mapStateToProps(state) {
|
function mapStateToProps(state) {
|
||||||
@ -40,6 +41,7 @@ function mapStateToProps(state) {
|
|||||||
requesterAddress: null,
|
requesterAddress: null,
|
||||||
conversionRate: conversionRateSelector(state),
|
conversionRate: conversionRateSelector(state),
|
||||||
mostRecentOverviewPage: getMostRecentOverviewPage(state),
|
mostRecentOverviewPage: getMostRecentOverviewPage(state),
|
||||||
|
nativeCurrency: getNativeCurrency(state),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user