From 0e5fd636d9e7e83aa6c4cce04b08a49a07e7add2 Mon Sep 17 00:00:00 2001 From: Usame Algan Date: Thu, 2 May 2024 16:01:12 +0200 Subject: [PATCH] fix: Disable execute button for pending transactions --- src/components/transactions/ExecuteTxButton/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/transactions/ExecuteTxButton/index.tsx b/src/components/transactions/ExecuteTxButton/index.tsx index 9aef958655..12b352cac9 100644 --- a/src/components/transactions/ExecuteTxButton/index.tsx +++ b/src/components/transactions/ExecuteTxButton/index.tsx @@ -1,3 +1,4 @@ +import useIsPending from '@/hooks/useIsPending' import type { SyntheticEvent } from 'react' import { type ReactElement, useContext } from 'react' import { type TransactionSummary } from '@safe-global/safe-gateway-typescript-sdk' @@ -23,11 +24,12 @@ const ExecuteTxButton = ({ const { setTxFlow } = useContext(TxModalContext) const { safe } = useSafeInfo() const txNonce = isMultisigExecutionInfo(txSummary.executionInfo) ? txSummary.executionInfo.nonce : undefined + const isPending = useIsPending(txSummary.id) const { setSelectedTxId } = useContext(ReplaceTxHoverContext) const safeSDK = useSafeSDK() const isNext = txNonce !== undefined && txNonce === safe.nonce - const isDisabled = !isNext || !safeSDK + const isDisabled = !isNext || !safeSDK || isPending const onClick = (e: SyntheticEvent) => { e.stopPropagation()