From d99aecc164d2d346e7ed0b680c3d58dcf033e261 Mon Sep 17 00:00:00 2001 From: OGPoyraz Date: Thu, 1 Jun 2023 11:48:07 +0200 Subject: [PATCH] deep clone signature tx in order to avoid state mutation bug on development (#19179) --- ui/pages/confirm-signature-request/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/pages/confirm-signature-request/index.js b/ui/pages/confirm-signature-request/index.js index cb4c52464..48d4d4c39 100644 --- a/ui/pages/confirm-signature-request/index.js +++ b/ui/pages/confirm-signature-request/index.js @@ -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() || {};