fix(explorer): avoid caching block list, cache block by id (#2238)

This commit is contained in:
Edd 2022-11-25 19:58:13 +00:00 committed by GitHub
parent 8489d50024
commit d5efae6419
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -26,7 +26,8 @@ export const TxDetailsWrapper = ({
const {
state: { data: blockData },
} = useFetch<TendermintBlocksResponse>(
`${DATA_SOURCES.tendermintUrl}/block?height=${height}`
`${DATA_SOURCES.tendermintUrl}/block?height=${height}`,
{ cache: 'force-cache' }
);
const child = useMemo(() => getTransactionComponent(txData), [txData]);

View File

@ -44,7 +44,7 @@ const Blocks = () => {
refetch,
} = useFetch<TendermintBlockchainResponse>(
`${DATA_SOURCES.tendermintUrl}/blockchain`,
undefined,
{ cache: 'no-cache' },
false
);

View File

@ -23,7 +23,8 @@ const Block = () => {
const {
state: { data: blockData, loading, error },
} = useFetch<TendermintBlocksResponse>(
`${DATA_SOURCES.tendermintUrl}/block?height=${block}`
`${DATA_SOURCES.tendermintUrl}/block?height=${block}`,
{ cache: 'force-cache' }
);
return (