Skip to content

Commit

Permalink
Merge pull request #732 from oasisprotocol/mz/cache
Browse files Browse the repository at this point in the history
Disable react-query cache in latest tx and blocks
  • Loading branch information
buberdds authored Jul 14, 2023
2 parents 180aaf2 + c5b21e5 commit 1226cc4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions .changelog/732.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Disable react-query cache in the latest tx and blocks
11 changes: 10 additions & 1 deletion src/app/pages/ParatimeDashboardPage/LatestBlocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,16 @@ export const LatestBlocks: FC<{ scope: SearchScope }> = ({ scope }) => {
// Listing the latest consensus blocks is not yet implemented.
// We should use useGetConsensusBlocks()
}
const blocksQuery = useGetRuntimeBlocks(network, layer, { limit })
const blocksQuery = useGetRuntimeBlocks(
network,
layer,
{ limit },
{
query: {
cacheTime: 0,
},
},
)

return (
<Card>
Expand Down
11 changes: 10 additions & 1 deletion src/app/pages/ParatimeDashboardPage/LatestTransactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,16 @@ export const LatestTransactions: FC<{ scope: SearchScope }> = ({ scope }) => {
// Listing the latest consensus transactions is not yet supported.
// We should use useGetConsensusTransactions()
}
const transactionsQuery = useGetRuntimeTransactions(network, layer, { limit })
const transactionsQuery = useGetRuntimeTransactions(
network,
layer,
{ limit },
{
query: {
cacheTime: 0,
},
},
)

return (
<Card>
Expand Down

0 comments on commit 1226cc4

Please sign in to comment.