From fe1562dcf639646a45c4c48e11459e1e9affc984 Mon Sep 17 00:00:00 2001 From: Tien Nam Dao Date: Wed, 22 Feb 2023 09:25:35 +0700 Subject: [PATCH] fix: add default value in setLatestBlock --- views/block/hook/useBlock.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/block/hook/useBlock.ts b/views/block/hook/useBlock.ts index f05237ff..509ab03b 100644 --- a/views/block/hook/useBlock.ts +++ b/views/block/hook/useBlock.ts @@ -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)