diff --git a/src/tx/index.tsx b/src/tx/index.tsx index 913af32..6ab6a96 100644 --- a/src/tx/index.tsx +++ b/src/tx/index.tsx @@ -46,6 +46,7 @@ interface TxProps { export const Tx: React.FunctionComponent = ({ id }) => { const [tx, setTx] = useState(); + const [initialised, setInitialised] = useState(false); const { get, response, loading, error } = useFetch(); @@ -56,7 +57,9 @@ export const Tx: React.FunctionComponent = ({ id }) => { // init useEffect(() => { - fetchTx(id).catch(() => `Error fetching tx details: ${id}`); + fetchTx(id) + .catch(() => `Error fetching tx details: ${id}`) + .finally(() => setInitialised(true)); }, []); useEffect(() => { @@ -89,7 +92,7 @@ export const Tx: React.FunctionComponent = ({ id }) => { const txTitleNode = ; - if (loading || !tx) { + if ((loading || !tx) && !initialised) { return (