mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Using native network currency for encryption public key requests (#11257)
Fixes MetaMask/metamask-extension#11247
This commit is contained in:
parent
e5a050b36f
commit
5afd1c9fa6
@ -30,6 +30,7 @@ export default class ConfirmEncryptionPublicKey extends Component {
|
|||||||
txData: PropTypes.object,
|
txData: PropTypes.object,
|
||||||
domainMetadata: PropTypes.object,
|
domainMetadata: PropTypes.object,
|
||||||
mostRecentOverviewPage: PropTypes.string.isRequired,
|
mostRecentOverviewPage: PropTypes.string.isRequired,
|
||||||
|
nativeCurrency: PropTypes.string.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@ -108,13 +109,13 @@ export default class ConfirmEncryptionPublicKey extends Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
renderBalance = () => {
|
renderBalance = () => {
|
||||||
const { conversionRate } = this.props;
|
const { conversionRate, nativeCurrency } = this.props;
|
||||||
const { t } = this.context;
|
const { t } = this.context;
|
||||||
const {
|
const {
|
||||||
fromAccount: { balance },
|
fromAccount: { balance },
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
const balanceInEther = conversionUtil(balance, {
|
const nativeCurrencyBalance = conversionUtil(balance, {
|
||||||
fromNumericBase: 'hex',
|
fromNumericBase: 'hex',
|
||||||
toNumericBase: 'dec',
|
toNumericBase: 'dec',
|
||||||
fromDenomination: 'WEI',
|
fromDenomination: 'WEI',
|
||||||
@ -128,7 +129,7 @@ export default class ConfirmEncryptionPublicKey extends Component {
|
|||||||
{`${t('balance')}:`}
|
{`${t('balance')}:`}
|
||||||
</div>
|
</div>
|
||||||
<div className="request-encryption-public-key__balance-value">
|
<div className="request-encryption-public-key__balance-value">
|
||||||
{`${balanceInEther} ETH`}
|
{`${nativeCurrencyBalance} ${nativeCurrency}`}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -16,6 +16,7 @@ import {
|
|||||||
|
|
||||||
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 ConfirmEncryptionPublicKey from './confirm-encryption-public-key.component';
|
import ConfirmEncryptionPublicKey from './confirm-encryption-public-key.component';
|
||||||
|
|
||||||
function mapStateToProps(state) {
|
function mapStateToProps(state) {
|
||||||
@ -39,6 +40,7 @@ function mapStateToProps(state) {
|
|||||||
requesterAddress: null,
|
requesterAddress: null,
|
||||||
conversionRate: conversionRateSelector(state),
|
conversionRate: conversionRateSelector(state),
|
||||||
mostRecentOverviewPage: getMostRecentOverviewPage(state),
|
mostRecentOverviewPage: getMostRecentOverviewPage(state),
|
||||||
|
nativeCurrency: getNativeCurrency(state),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user