Skip to content

Commit

Permalink
Add useState hook to HealthIndicator component
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennievon committed Jan 26, 2024
1 parent a99f11f commit 5569922
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { useEffect } from "react";
import React, { useEffect, useState } from "react";
import { Badge, badgeVariants } from "./ui/badge";
import useGatewayService from "@/services/useGatewayService";
import { Skeleton } from "./ui/skeleton";

const HealthIndicator = () => {
const { getTestnetStatus } = useGatewayService();
const [loading, setLoading] = React.useState(false);
const [status, setStatus] = React.useState<boolean>();
const [loading, setLoading] = useState(false);
const [status, setStatus] = useState<boolean>();

const testnetStatus = async () => {
setLoading(true);
Expand All @@ -31,7 +31,7 @@ const HealthIndicator = () => {
if (res?.result?.OverallHealth) {
setStatus(true);
} else if (
res?.result?.Errors?.map((e: string) => e.includes("[p2p]"))
res?.result?.Errors?.some((e: string) => e.includes("[p2p]"))
) {
setStatus(true);
} else {
Expand Down

0 comments on commit 5569922

Please sign in to comment.