Polish block transaction drilldown cleanup
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user