From 179e60bd5cce2a99a3cc2f4b9152a0dc99e33ec2 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 9 Mar 2023 09:36:30 +0200 Subject: [PATCH] fix: isError condition --- src/hooks/useLastTxLocalStatus.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/hooks/useLastTxLocalStatus.tsx b/src/hooks/useLastTxLocalStatus.tsx index 6e40554..99ab235 100644 --- a/src/hooks/useLastTxLocalStatus.tsx +++ b/src/hooks/useLastTxLocalStatus.tsx @@ -1,7 +1,11 @@ import { useEffect, useState } from 'react'; import { selectLastTxByTypeAndPayload } from '../web3/store/transactionsSelectors'; -import { BaseTx, ITransactionsState } from '../web3/store/transactionsSlice'; +import { + BaseTx, + isGelatoBaseTx, + ITransactionsState, +} from '../web3/store/transactionsSlice'; interface LastTxStatusesParams { state: ITransactionsState; @@ -33,8 +37,9 @@ export const useLastTxLocalStatus = ({ const txChainId = tx && tx.chainId; const txWalletType = tx && tx.walletType; const isError = - (tx && !tx.pending && tx && (tx.status === 2 || tx.status === 0)) || - !!error; + tx && isGelatoBaseTx(tx) + ? !tx.pending && (tx.status === 2 || tx.status === 0 || !!error) + : (tx && !tx.pending && (tx.status === 2 || tx.status === 0)) || !!error; useEffect(() => { if (txPending || isError) {