From 0bd9353e603506b974cb87ea89c248f2c1b3a582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Mart=C3=ADnez?= Date: Fri, 22 Nov 2019 12:24:23 +0100 Subject: [PATCH] Fix confirmation+execution check --- .../TxsTable/ExpandedTx/ApproveTxModal/index.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/ApproveTxModal/index.jsx b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/ApproveTxModal/index.jsx index a8dadc3f..55414fda 100644 --- a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/ApproveTxModal/index.jsx +++ b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/ApproveTxModal/index.jsx @@ -64,10 +64,10 @@ const ApproveTxModal = ({ enqueueSnackbar, closeSnackbar, }: Props) => { - const [approveAndExecute, setApproveAndExecute] = useState(true) + const oneConfirmationLeft = !thresholdReached && tx.confirmations.size + 1 === threshold + const [approveAndExecute, setApproveAndExecute] = useState(oneConfirmationLeft || thresholdReached) const [gasCosts, setGasCosts] = useState('< 0.001') const { title, description } = getModalTitleAndDescription(thresholdReached) - const oneConfirmationLeft = tx.confirmations.size + 1 === threshold useEffect(() => { let isCurrent = true @@ -107,7 +107,7 @@ const ApproveTxModal = ({ TX_NOTIFICATION_TYPES.CONFIRMATION_TX, enqueueSnackbar, closeSnackbar, - approveAndExecute, + approveAndExecute && oneConfirmationLeft, ) onClose() } @@ -131,7 +131,7 @@ const ApproveTxModal = ({
{tx.nonce} - {!thresholdReached && oneConfirmationLeft && ( + {oneConfirmationLeft && ( <> Approving this transaction executes it right away. If you want approve but execute the transaction