From a4df6d7555ee25634ae466a94f653c6a1d68c05c Mon Sep 17 00:00:00 2001 From: ChiaMineJP Date: Wed, 20 Sep 2023 21:41:42 +0900 Subject: [PATCH] Fixed farm page crash --- packages/api/src/@types/BlockchainState.ts | 2 +- packages/gui/src/components/farm/FarmHealth.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/api/src/@types/BlockchainState.ts b/packages/api/src/@types/BlockchainState.ts index f8a6986c11..3f1af4a790 100644 --- a/packages/api/src/@types/BlockchainState.ts +++ b/packages/api/src/@types/BlockchainState.ts @@ -53,7 +53,7 @@ type BlockchainState = { mempoolMinFees: MempoolMinFees; mempoolSize: number; nodeId: string; - peak: Peak; + peak: Peak | null; // Until FullNode is initialized, `peak` is `None(null)` space: number; averageBlockTime: number; subSlotIters: number; diff --git a/packages/gui/src/components/farm/FarmHealth.tsx b/packages/gui/src/components/farm/FarmHealth.tsx index 94de03838e..7f70f7057a 100644 --- a/packages/gui/src/components/farm/FarmHealth.tsx +++ b/packages/gui/src/components/farm/FarmHealth.tsx @@ -95,7 +95,7 @@ function FarmHealth() { const { data: poolStateData, isLoading: isLoadingPoolStateData } = useGetPoolStateQuery(); const isTestnet = (useCurrencyCode() ?? 'XCH').toUpperCase() === 'TXCH'; const { data: filterChallengeStat, isLoading: isLoadingFilterChallengeStat } = useGetFilterChallengeStatQuery({ - height: blockchainState?.peak.height || 0, + height: blockchainState?.peak?.height || 0, isTestnet, }); const [resetFilterChallengeStat] = useResetFilterChallengeStatMutation();