diff --git a/package-lock.json b/package-lock.json index 9092f4d2a7..bbbbeac26d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@balancer-labs/frontend-v2", - "version": "1.23.3", + "version": "1.23.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@balancer-labs/frontend-v2", - "version": "1.23.3", + "version": "1.23.4", "license": "MIT", "dependencies": { "@balancer-labs/assets": "github:balancer-labs/assets#master", diff --git a/package.json b/package.json index 3da1e4bfd6..db302e6da9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@balancer-labs/frontend-v2", - "version": "1.23.3", + "version": "1.23.4", "engines": { "node": "14.x", "npm": ">=7" diff --git a/src/composables/useTransactions.ts b/src/composables/useTransactions.ts index 0b44670667..4139ba75e9 100644 --- a/src/composables/useTransactions.ts +++ b/src/composables/useTransactions.ts @@ -396,25 +396,27 @@ export default function useTransactions() { } function checkTxActivity(transaction: Transaction) { - provider.value - .getTransactionReceipt(transaction.id) - .then(tx => { - if (tx != null) { - finalizeTransaction(transaction.id, 'tx', tx); - } - }) - .catch(e => - console.log( - '[Transactions]: Failed to fetch tx information', - transaction, - e - ) - ) - .finally(() => - updateTransaction(transaction.id, 'tx', { - lastCheckedBlockNumber: blockNumber.value + if (provider.value != null) { + provider.value + .getTransactionReceipt(transaction.id) + .then(tx => { + if (tx != null) { + finalizeTransaction(transaction.id, 'tx', tx); + } }) - ); + .catch(e => + console.log( + '[Transactions]: Failed to fetch tx information', + transaction, + e + ) + ) + .finally(() => + updateTransaction(transaction.id, 'tx', { + lastCheckedBlockNumber: blockNumber.value + }) + ); + } } async function handlePendingTransactions() { diff --git a/src/composables/watchers/useWeb3Watchers.ts b/src/composables/watchers/useWeb3Watchers.ts index 035b3da878..3f7c357672 100644 --- a/src/composables/watchers/useWeb3Watchers.ts +++ b/src/composables/watchers/useWeb3Watchers.ts @@ -19,7 +19,8 @@ export default function useWeb3Watchers() { isMismatchedNetwork, isUnsupportedNetwork, blockNumber, - connectToAppNetwork + connectToAppNetwork, + isWalletReady } = useWeb3(); const { addAlert, removeAlert } = useAlerts(); const { refetchBalances, refetchAllowances } = useTokens(); @@ -92,6 +93,8 @@ export default function useWeb3Watchers() { }); watch(blockNumber, async () => { - handlePendingTransactions(); + if (isWalletReady.value) { + handlePendingTransactions(); + } }); }