From 9e7acf9935f6deca1eadbf4f762b188075dcb852 Mon Sep 17 00:00:00 2001 From: cuteolaf Date: Fri, 26 Jul 2024 04:44:22 -0700 Subject: [PATCH] fix validator page --- src/screens/validator.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/screens/validator.tsx b/src/screens/validator.tsx index 33fff098..70e92155 100644 --- a/src/screens/validator.tsx +++ b/src/screens/validator.tsx @@ -40,6 +40,7 @@ import { useValidator7DayMA } from "../hooks/useValidators7DayMA"; import { Validator7DayMAChart } from "../components/validators/Validator7DayMAChart"; import { useExtrinsics } from "../hooks/useExtrinsics"; import ExtrinsicsTable from "../components/extrinsics/ExtrinsicsTable"; +import Loading from "../components/Loading"; const validatorHeader = (theme: Theme) => css` display: flex; @@ -210,7 +211,7 @@ export const ValidatorPage = () => { const validator = useValidator({ address: { equalTo: address } }); const { - state: { chainStats }, + state: { chainStats, chainLoading }, } = useAppStats(); const verifiedDelegates = useVerifiedDelegates(); @@ -316,8 +317,8 @@ export const ValidatorPage = () => { const sevenDaysMA = useValidator7DayMA(address); - return chainStats === undefined ? ( - <> + return chainLoading || chainStats === undefined || validator.loading ? ( + ) : validator.notFound || validator.data === undefined || validator.data.height < Number(chainStats.blocksFinalized) - 7200 ? (