From 7b544c699ffb6e3b7bed464ab7f8053a2ee3ed18 Mon Sep 17 00:00:00 2001 From: verkhohliad Date: Thu, 1 Aug 2024 14:39:51 +0100 Subject: [PATCH] minor fixes --- src/shared/ShutterTimer/ShutterTimer.tsx | 2 +- src/shared/ShutterTimer/useGetValidatorRegistryLogs.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/ShutterTimer/ShutterTimer.tsx b/src/shared/ShutterTimer/ShutterTimer.tsx index c1aea50..cd96eb9 100644 --- a/src/shared/ShutterTimer/ShutterTimer.tsx +++ b/src/shared/ShutterTimer/ShutterTimer.tsx @@ -45,7 +45,7 @@ export const ShutterTimer = () => { const interval = setInterval(() => { const currentSlot = getSlot(chain.genesisTime); - const match = matches.find((m: any) => m.slot > currentSlot); + const match = matches.find((m: any) => Number(m.slot) > currentSlot); if (!match) { setTimeDifference(0); diff --git a/src/shared/ShutterTimer/useGetValidatorRegistryLogs.ts b/src/shared/ShutterTimer/useGetValidatorRegistryLogs.ts index f854f52..951f70f 100644 --- a/src/shared/ShutterTimer/useGetValidatorRegistryLogs.ts +++ b/src/shared/ShutterTimer/useGetValidatorRegistryLogs.ts @@ -32,7 +32,7 @@ export const useGetValidatorRegistryLogs = (chainId: number, lastBlockNumber: nu allLogs = [...allLogs, ...(logs ?? [])]; - if (logs.length < SUB_GRAPH_MAX_QUERY_LOGS) { + if (!logs || logs.length < SUB_GRAPH_MAX_QUERY_LOGS) { break; // Break the loop if the number of logs fetched is less than 'first', indicating the end of data } }