Polish block transaction drilldown cleanup

This commit is contained in:
defiQUG
2026-04-16 14:57:12 -07:00
parent 945864af7a
commit c01e7c2c4a
2 changed files with 20 additions and 28 deletions

View File

@@ -29,24 +29,16 @@ export function useBlockTransactions({ blockNumber, chainId, enabled }: UseBlock
setLoading(true)
setError(false)
try {
const result = await transactionsApi.listByBlockSafe(
chainId,
blockNumber,
page,
DEFAULT_BLOCK_TRANSACTION_PAGE_SIZE,
)
setTransactions(result.items)
setHasNextPage(result.hasNextPage)
setError(!result.ok)
} catch (loadError) {
console.error('Failed to load block transactions:', loadError)
setTransactions([])
setHasNextPage(false)
setError(true)
} finally {
setLoading(false)
}
const result = await transactionsApi.listByBlockSafe(
chainId,
blockNumber,
page,
DEFAULT_BLOCK_TRANSACTION_PAGE_SIZE,
)
setTransactions(result.items)
setHasNextPage(result.hasNextPage)
setError(!result.ok)
setLoading(false)
}, [blockNumber, chainId, enabled, page])
useEffect(() => {