From d5efae64197c1b8b62e819f64c6475b25308d30f Mon Sep 17 00:00:00 2001 From: Edd Date: Fri, 25 Nov 2022 19:58:13 +0000 Subject: [PATCH] fix(explorer): avoid caching block list, cache block by id (#2238) --- .../src/app/components/txs/details/tx-details-wrapper.tsx | 3 ++- apps/explorer/src/app/routes/blocks/home/index.tsx | 2 +- apps/explorer/src/app/routes/blocks/id/block.tsx | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/explorer/src/app/components/txs/details/tx-details-wrapper.tsx b/apps/explorer/src/app/components/txs/details/tx-details-wrapper.tsx index 413a46c9a..9d1aa0654 100644 --- a/apps/explorer/src/app/components/txs/details/tx-details-wrapper.tsx +++ b/apps/explorer/src/app/components/txs/details/tx-details-wrapper.tsx @@ -26,7 +26,8 @@ export const TxDetailsWrapper = ({ const { state: { data: blockData }, } = useFetch( - `${DATA_SOURCES.tendermintUrl}/block?height=${height}` + `${DATA_SOURCES.tendermintUrl}/block?height=${height}`, + { cache: 'force-cache' } ); const child = useMemo(() => getTransactionComponent(txData), [txData]); diff --git a/apps/explorer/src/app/routes/blocks/home/index.tsx b/apps/explorer/src/app/routes/blocks/home/index.tsx index d7f65eb40..086eb3672 100644 --- a/apps/explorer/src/app/routes/blocks/home/index.tsx +++ b/apps/explorer/src/app/routes/blocks/home/index.tsx @@ -44,7 +44,7 @@ const Blocks = () => { refetch, } = useFetch( `${DATA_SOURCES.tendermintUrl}/blockchain`, - undefined, + { cache: 'no-cache' }, false ); diff --git a/apps/explorer/src/app/routes/blocks/id/block.tsx b/apps/explorer/src/app/routes/blocks/id/block.tsx index 5e86aff6e..24c2ffc8b 100644 --- a/apps/explorer/src/app/routes/blocks/id/block.tsx +++ b/apps/explorer/src/app/routes/blocks/id/block.tsx @@ -23,7 +23,8 @@ const Block = () => { const { state: { data: blockData, loading, error }, } = useFetch( - `${DATA_SOURCES.tendermintUrl}/block?height=${block}` + `${DATA_SOURCES.tendermintUrl}/block?height=${block}`, + { cache: 'force-cache' } ); return (