mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Show correct base asset in Signature Request view (#12696)
This commit is contained in:
parent
a323a5fe59
commit
a2033377e9
@ -35,6 +35,7 @@ export default class SignatureRequestOriginal extends Component {
|
||||
domainMetadata: PropTypes.object,
|
||||
hardwareWalletRequiresConnection: PropTypes.bool,
|
||||
isLedgerWallet: PropTypes.bool,
|
||||
nativeCurrency: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
state = {
|
||||
@ -74,12 +75,12 @@ export default class SignatureRequestOriginal extends Component {
|
||||
};
|
||||
|
||||
renderBalance = () => {
|
||||
const { conversionRate } = this.props;
|
||||
const { conversionRate, nativeCurrency } = this.props;
|
||||
const {
|
||||
fromAccount: { balance },
|
||||
} = this.state;
|
||||
|
||||
const balanceInEther = conversionUtil(balance, {
|
||||
const balanceInBaseAsset = conversionUtil(balance, {
|
||||
fromNumericBase: 'hex',
|
||||
toNumericBase: 'dec',
|
||||
fromDenomination: 'WEI',
|
||||
@ -93,7 +94,7 @@ export default class SignatureRequestOriginal extends Component {
|
||||
{`${this.context.t('balance')}:`}
|
||||
</div>
|
||||
<div className="request-signature__balance-value">
|
||||
{`${balanceInEther} ETH`}
|
||||
{`${balanceInBaseAsset} ${nativeCurrency}`}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
@ -13,7 +13,10 @@ import {
|
||||
import { getAccountByAddress } from '../../../helpers/utils/util';
|
||||
import { clearConfirmTransaction } from '../../../ducks/confirm-transaction/confirm-transaction.duck';
|
||||
import { getMostRecentOverviewPage } from '../../../ducks/history/history';
|
||||
import { isAddressLedger } from '../../../ducks/metamask/metamask';
|
||||
import {
|
||||
isAddressLedger,
|
||||
getNativeCurrency,
|
||||
} from '../../../ducks/metamask/metamask';
|
||||
import SignatureRequestOriginal from './signature-request-original.component';
|
||||
|
||||
function mapStateToProps(state, ownProps) {
|
||||
@ -34,6 +37,7 @@ function mapStateToProps(state, ownProps) {
|
||||
mostRecentOverviewPage: getMostRecentOverviewPage(state),
|
||||
hardwareWalletRequiresConnection,
|
||||
isLedgerWallet,
|
||||
nativeCurrency: getNativeCurrency(state),
|
||||
// not passed to component
|
||||
allAccounts: accountsWithSendEtherInfoSelector(state),
|
||||
domainMetadata: getDomainMetadata(state),
|
||||
|
Loading…
Reference in New Issue
Block a user