Prevent redux state mutation (#7598)

The `txParams` property of a transaction in Redux state was being
mutated. The mutation is now prevented with a shallow clone.
feature/default_network_editable
Mark Stacey 5 years ago committed by GitHub
parent f61b068bd2
commit 3722de8b29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      ui/app/ducks/metamask/metamask.js

@ -322,7 +322,9 @@ function reduceMetamask (state, action) {
let { selectedAddressTxList } = metamaskState
selectedAddressTxList = selectedAddressTxList.map(tx => {
if (tx.id === txId) {
tx.txParams = value
const newTx = Object.assign({}, tx)
newTx.txParams = value
return newTx
}
return tx
})

Loading…
Cancel
Save