mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +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:
parent
ff6b254a9b
commit
77449923c3
@ -322,7 +322,9 @@ function reduceMetamask (state, action) {
|
|||||||
let { selectedAddressTxList } = metamaskState
|
let { selectedAddressTxList } = metamaskState
|
||||||
selectedAddressTxList = selectedAddressTxList.map(tx => {
|
selectedAddressTxList = selectedAddressTxList.map(tx => {
|
||||||
if (tx.id === txId) {
|
if (tx.id === txId) {
|
||||||
tx.txParams = value
|
const newTx = Object.assign({}, tx)
|
||||||
|
newTx.txParams = value
|
||||||
|
return newTx
|
||||||
}
|
}
|
||||||
return tx
|
return tx
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user