Fix signalling tx not found on network error

This commit is contained in:
Willian Mitsuda 2022-01-24 16:36:16 -03:00
parent e62068c65a
commit f138444eee
1 changed files with 98 additions and 89 deletions

View File

@ -191,6 +191,7 @@ export const useTxData = (
} }
const readTxData = async () => { const readTxData = async () => {
try {
const [_response, _receipt] = await Promise.all([ const [_response, _receipt] = await Promise.all([
provider.getTransaction(txhash), provider.getTransaction(txhash),
provider.getTransactionReceipt(txhash), provider.getTransactionReceipt(txhash),
@ -246,7 +247,10 @@ export const useTxData = (
}; };
} catch (err) { } catch (err) {
tokenMetas[t.token] = null; tokenMetas[t.token] = null;
console.warn(`Couldn't get token ${t.token} metadata; ignoring`, err); console.warn(
`Couldn't get token ${t.token} metadata; ignoring`,
err
);
} }
} }
@ -282,7 +286,12 @@ export const useTxData = (
logs: _receipt.logs, logs: _receipt.logs,
}, },
}); });
} catch (err) {
console.error(err);
setTxData(null);
}
}; };
readTxData(); readTxData();
}, [provider, txhash]); }, [provider, txhash]);