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

deep clone signature tx in order to avoid state mutation bug on development (#19179)

This commit is contained in:
OGPoyraz 2023-06-01 11:48:07 +02:00 committed by GitHub
parent 20f028bf6f
commit d99aecc164
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@ import React, { useEffect, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { withRouter } from 'react-router-dom';
import log from 'loglevel';
import { cloneDeep } from 'lodash';
import * as actions from '../../store/actions';
import txHelper from '../../helpers/utils/tx-helper';
import SignatureRequest from '../../components/app/signature-request';
@ -168,9 +169,10 @@ const ConfirmTxScreen = ({ match }) => {
log.info(`rendering a combined ${unconfTxList.length} unconf msgs & txs`);
return transactionId
const unconfirmedTx = transactionId
? unconfTxList.find(({ id }) => `${id}` === transactionId)
: unconfTxList[index];
return cloneDeep(unconfirmedTx);
};
const txData = getTxData() || {};