mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-10-22 19:26:13 +02: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
591fe1a0a6
commit
97013d8028
@ -2,6 +2,7 @@ import React, { Component } from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import copyToClipboard from 'copy-to-clipboard';
|
import copyToClipboard from 'copy-to-clipboard';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
|
import log from 'loglevel';
|
||||||
|
|
||||||
import AccountListItem from '../../components/app/account-list-item';
|
import AccountListItem from '../../components/app/account-list-item';
|
||||||
import Identicon from '../../components/ui/identicon';
|
import Identicon from '../../components/ui/identicon';
|
||||||
@ -298,6 +299,11 @@ export default class ConfirmDecryptMessage extends Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render = () => {
|
render = () => {
|
||||||
|
if (!this.props.txData) {
|
||||||
|
log.warn('ConfirmDecryptMessage Page: Missing txData prop.');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="request-decrypt-message__container">
|
<div className="request-decrypt-message__container">
|
||||||
{this.renderHeader()}
|
{this.renderHeader()}
|
||||||
|
@ -27,11 +27,10 @@ function mapStateToProps(state) {
|
|||||||
|
|
||||||
const txData = unconfirmedTransactions[0];
|
const txData = unconfirmedTransactions[0];
|
||||||
|
|
||||||
const {
|
const fromAccount = getTargetAccountWithSendEtherInfo(
|
||||||
msgParams: { from },
|
state,
|
||||||
} = txData;
|
txData?.msgParams?.from,
|
||||||
|
);
|
||||||
const fromAccount = getTargetAccountWithSendEtherInfo(state, from);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
txData,
|
txData,
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import log from 'loglevel';
|
||||||
|
|
||||||
import AccountListItem from '../../components/app/account-list-item';
|
import AccountListItem from '../../components/app/account-list-item';
|
||||||
import Identicon from '../../components/ui/identicon';
|
import Identicon from '../../components/ui/identicon';
|
||||||
@ -197,6 +198,11 @@ export default class ConfirmEncryptionPublicKey extends Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render = () => {
|
render = () => {
|
||||||
|
if (!this.props.txData) {
|
||||||
|
log.warn('ConfirmEncryptionPublicKey Page: Missing txData prop.');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="request-encryption-public-key__container">
|
<div className="request-encryption-public-key__container">
|
||||||
{this.renderHeader()}
|
{this.renderHeader()}
|
||||||
|
@ -28,9 +28,10 @@ function mapStateToProps(state) {
|
|||||||
|
|
||||||
const txData = unconfirmedTransactions[0];
|
const txData = unconfirmedTransactions[0];
|
||||||
|
|
||||||
const { msgParams: from } = txData;
|
const fromAccount = getTargetAccountWithSendEtherInfo(
|
||||||
|
state,
|
||||||
const fromAccount = getTargetAccountWithSendEtherInfo(state, from);
|
txData?.msgParams,
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
txData,
|
txData,
|
||||||
|
Loading…
Reference in New Issue
Block a user