1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00

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.
This commit is contained in:
Mark Stacey 2019-11-28 18:59:15 -04:00 committed by GitHub
parent f61b068bd2
commit 3722de8b29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
})