From 60f257fd62b06f12465b9273af779c14357f3629 Mon Sep 17 00:00:00 2001 From: Ariella Vu <20778143+digiwand@users.noreply.github.com> Date: Sat, 25 Feb 2023 02:02:02 +0700 Subject: [PATCH] ConfirmDecryptMessage: avoid mutation of state in decryptMsg/completedTx action (#17895) * fix ConfirmEncryptionPublicKey txData * encrypt/decrypt: fix missing txData state * rm console.log * ConfirmDecryptMessage: cloneDeep to avoid mutation --- .../confirm-decrypt-message.container.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/pages/confirm-decrypt-message/confirm-decrypt-message.container.js b/ui/pages/confirm-decrypt-message/confirm-decrypt-message.container.js index 57358ecdd..65cc9ed3e 100644 --- a/ui/pages/confirm-decrypt-message/confirm-decrypt-message.container.js +++ b/ui/pages/confirm-decrypt-message/confirm-decrypt-message.container.js @@ -1,6 +1,7 @@ import { connect } from 'react-redux'; import { compose } from 'redux'; import { withRouter } from 'react-router-dom'; +import { cloneDeep } from 'lodash'; import { goHome, @@ -25,7 +26,7 @@ function mapStateToProps(state) { const unconfirmedTransactions = unconfirmedTransactionsListSelector(state); - const txData = unconfirmedTransactions[0]; + const txData = cloneDeep(unconfirmedTransactions[0]); const fromAccount = getTargetAccountWithSendEtherInfo( state,