From a90f631a3ebbb249d281743e71da491f5a7968c2 Mon Sep 17 00:00:00 2001 From: Matthew Russell Date: Sat, 11 Nov 2023 13:58:50 -0800 Subject: [PATCH] test: fix use node health hook --- libs/environment/src/hooks/use-node-health.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/environment/src/hooks/use-node-health.ts b/libs/environment/src/hooks/use-node-health.ts index 8cb092d86..ba2f8549b 100644 --- a/libs/environment/src/hooks/use-node-health.ts +++ b/libs/environment/src/hooks/use-node-health.ts @@ -22,7 +22,7 @@ export const useNodeHealth = () => { }); const blockDiff = useMemo(() => { - if (!data?.statistics.blockHeight) { + if (!data?.statistics?.blockHeight) { return null; } @@ -31,7 +31,7 @@ export const useNodeHealth = () => { } return Number(data.statistics.blockHeight) - headers.blockHeight; - }, [data?.statistics.blockHeight, headers?.blockHeight]); + }, [data?.statistics?.blockHeight, headers?.blockHeight]); useEffect(() => { if (error) {