fix(explorer): avoid caching block list, cache block by id (#2238)
This commit is contained in:
parent
8489d50024
commit
d5efae6419
@ -26,7 +26,8 @@ export const TxDetailsWrapper = ({
|
|||||||
const {
|
const {
|
||||||
state: { data: blockData },
|
state: { data: blockData },
|
||||||
} = useFetch<TendermintBlocksResponse>(
|
} = useFetch<TendermintBlocksResponse>(
|
||||||
`${DATA_SOURCES.tendermintUrl}/block?height=${height}`
|
`${DATA_SOURCES.tendermintUrl}/block?height=${height}`,
|
||||||
|
{ cache: 'force-cache' }
|
||||||
);
|
);
|
||||||
|
|
||||||
const child = useMemo(() => getTransactionComponent(txData), [txData]);
|
const child = useMemo(() => getTransactionComponent(txData), [txData]);
|
||||||
|
@ -44,7 +44,7 @@ const Blocks = () => {
|
|||||||
refetch,
|
refetch,
|
||||||
} = useFetch<TendermintBlockchainResponse>(
|
} = useFetch<TendermintBlockchainResponse>(
|
||||||
`${DATA_SOURCES.tendermintUrl}/blockchain`,
|
`${DATA_SOURCES.tendermintUrl}/blockchain`,
|
||||||
undefined,
|
{ cache: 'no-cache' },
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -23,7 +23,8 @@ const Block = () => {
|
|||||||
const {
|
const {
|
||||||
state: { data: blockData, loading, error },
|
state: { data: blockData, loading, error },
|
||||||
} = useFetch<TendermintBlocksResponse>(
|
} = useFetch<TendermintBlocksResponse>(
|
||||||
`${DATA_SOURCES.tendermintUrl}/block?height=${block}`
|
`${DATA_SOURCES.tendermintUrl}/block?height=${block}`,
|
||||||
|
{ cache: 'force-cache' }
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user