mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +01:00
Fix GetEncryptionKey TypeError Cannot destructure property 'msgParams' of 'txData' (#17808)
* fix ConfirmEncryptionPublicKey txData * encrypt/decrypt: fix missing txData state * rm console.log
This commit is contained in:
parent
9f17e2f94b
commit
bdf3b8486b
@ -2,6 +2,7 @@ import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import copyToClipboard from 'copy-to-clipboard';
|
||||
import classnames from 'classnames';
|
||||
import log from 'loglevel';
|
||||
|
||||
import AccountListItem from '../../components/app/account-list-item';
|
||||
import Identicon from '../../components/ui/identicon';
|
||||
@ -298,6 +299,11 @@ export default class ConfirmDecryptMessage extends Component {
|
||||
};
|
||||
|
||||
render = () => {
|
||||
if (!this.props.txData) {
|
||||
log.warn('ConfirmDecryptMessage Page: Missing txData prop.');
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="request-decrypt-message__container">
|
||||
{this.renderHeader()}
|
||||
|
@ -27,11 +27,10 @@ function mapStateToProps(state) {
|
||||
|
||||
const txData = unconfirmedTransactions[0];
|
||||
|
||||
const {
|
||||
msgParams: { from },
|
||||
} = txData;
|
||||
|
||||
const fromAccount = getTargetAccountWithSendEtherInfo(state, from);
|
||||
const fromAccount = getTargetAccountWithSendEtherInfo(
|
||||
state,
|
||||
txData?.msgParams?.from,
|
||||
);
|
||||
|
||||
return {
|
||||
txData,
|
||||
|
@ -1,5 +1,6 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import log from 'loglevel';
|
||||
|
||||
import AccountListItem from '../../components/app/account-list-item';
|
||||
import Identicon from '../../components/ui/identicon';
|
||||
@ -197,6 +198,11 @@ export default class ConfirmEncryptionPublicKey extends Component {
|
||||
};
|
||||
|
||||
render = () => {
|
||||
if (!this.props.txData) {
|
||||
log.warn('ConfirmEncryptionPublicKey Page: Missing txData prop.');
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="request-encryption-public-key__container">
|
||||
{this.renderHeader()}
|
||||
|
@ -28,9 +28,10 @@ function mapStateToProps(state) {
|
||||
|
||||
const txData = unconfirmedTransactions[0];
|
||||
|
||||
const { msgParams: from } = txData;
|
||||
|
||||
const fromAccount = getTargetAccountWithSendEtherInfo(state, from);
|
||||
const fromAccount = getTargetAccountWithSendEtherInfo(
|
||||
state,
|
||||
txData?.msgParams,
|
||||
);
|
||||
|
||||
return {
|
||||
txData,
|
||||
|
Loading…
Reference in New Issue
Block a user