Skip to content

Commit

Permalink
fix validator page
Browse files Browse the repository at this point in the history
  • Loading branch information
cuteolaf committed Jul 26, 2024
1 parent 1432f04 commit 9e7acf9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/screens/validator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -210,7 +211,7 @@ export const ValidatorPage = () => {

const validator = useValidator({ address: { equalTo: address } });
const {
state: { chainStats },
state: { chainStats, chainLoading },
} = useAppStats();

const verifiedDelegates = useVerifiedDelegates();
Expand Down Expand Up @@ -316,8 +317,8 @@ export const ValidatorPage = () => {

const sevenDaysMA = useValidator7DayMA(address);

return chainStats === undefined ? (
<></>
return chainLoading || chainStats === undefined || validator.loading ? (
<Loading />
) : validator.notFound ||
validator.data === undefined ||
validator.data.height < Number(chainStats.blocksFinalized) - 7200 ? (
Expand Down

0 comments on commit 9e7acf9

Please sign in to comment.