Merge branch 'bug/execute-tx-XooY' into development

This commit is contained in:
Germán Martínez 2019-11-22 13:25:05 +01:00
commit 2a37166d4f
1 changed files with 4 additions and 4 deletions

View File

@ -64,10 +64,10 @@ const ApproveTxModal = ({
enqueueSnackbar, enqueueSnackbar,
closeSnackbar, closeSnackbar,
}: Props) => { }: Props) => {
const [approveAndExecute, setApproveAndExecute] = useState<boolean>(true) const oneConfirmationLeft = !thresholdReached && tx.confirmations.size + 1 === threshold
const [approveAndExecute, setApproveAndExecute] = useState<boolean>(oneConfirmationLeft || thresholdReached)
const [gasCosts, setGasCosts] = useState<string>('< 0.001') const [gasCosts, setGasCosts] = useState<string>('< 0.001')
const { title, description } = getModalTitleAndDescription(thresholdReached) const { title, description } = getModalTitleAndDescription(thresholdReached)
const oneConfirmationLeft = tx.confirmations.size + 1 === threshold
useEffect(() => { useEffect(() => {
let isCurrent = true let isCurrent = true
@ -107,7 +107,7 @@ const ApproveTxModal = ({
TX_NOTIFICATION_TYPES.CONFIRMATION_TX, TX_NOTIFICATION_TYPES.CONFIRMATION_TX,
enqueueSnackbar, enqueueSnackbar,
closeSnackbar, closeSnackbar,
approveAndExecute, approveAndExecute && oneConfirmationLeft,
) )
onClose() onClose()
} }
@ -131,7 +131,7 @@ const ApproveTxModal = ({
<br /> <br />
<Bold className={classes.nonceNumber}>{tx.nonce}</Bold> <Bold className={classes.nonceNumber}>{tx.nonce}</Bold>
</Paragraph> </Paragraph>
{!thresholdReached && oneConfirmationLeft && ( {oneConfirmationLeft && (
<> <>
<Paragraph color="error"> <Paragraph color="error">
Approving this transaction executes it right away. If you want approve but execute the transaction Approving this transaction executes it right away. If you want approve but execute the transaction