Skip to content

Commit

Permalink
fix: add default value in setLatestBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
Tien Nam Dao committed Feb 22, 2023
1 parent 1eb695d commit fe1562d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion views/block/hook/useBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function useBlock() {
if (data?.result) {
// Dispatch latest block for cache
// Do not call directly get eth-block-number -> It dumps BE
dispatch(setLatestBlock(data?.result?.[0].blockHeight + 1))
dispatch(setLatestBlock((data?.result?.[0].blockHeight || 0) + 1))

if (pagination.page === 1 && isEmpty(_items)) {
_setBlockItem(data?.result)
Expand Down

0 comments on commit fe1562d

Please sign in to comment.