diff --git a/web/src/components/ClaimPnkButton.tsx b/web/src/components/ClaimPnkButton.tsx index 84109065d..04f6a3698 100644 --- a/web/src/components/ClaimPnkButton.tsx +++ b/web/src/components/ClaimPnkButton.tsx @@ -8,6 +8,7 @@ import { Button } from "@kleros/ui-components-library"; import FaucetIcon from "svgs/icons/faucet.svg"; import { DEFAULT_CHAIN } from "consts/chains"; +import { REFETCH_INTERVAL } from "consts/index"; import { simulatePnkFaucet, useReadPnkBalanceOf, @@ -26,12 +27,12 @@ const ClaimPnkButton: React.FC = () => { const [isPopupOpen, setIsPopupOpen] = useState(false); const [hash, setHash] = useState<`0x${string}` | undefined>(); - // TODO watch const chainId = useChainId(); const { address } = useAccount(); const { data: claimed } = useReadPnkFaucetWithdrewAlready({ query: { enabled: !isUndefined(address), + refetchInterval: REFETCH_INTERVAL, }, args: [address ?? "0x00"], }); diff --git a/web/src/components/Verdict/FinalDecision.tsx b/web/src/components/Verdict/FinalDecision.tsx index e1d7bb00f..e077d1169 100644 --- a/web/src/components/Verdict/FinalDecision.tsx +++ b/web/src/components/Verdict/FinalDecision.tsx @@ -7,6 +7,7 @@ import { useAccount } from "wagmi"; import ArrowIcon from "assets/svgs/icons/arrow.svg"; +import { REFETCH_INTERVAL } from "consts/index"; import { Periods } from "consts/periods"; import { useReadKlerosCoreCurrentRuling } from "hooks/contracts/generated"; import { usePopulatedDisputeData } from "hooks/queries/usePopulatedDisputeData"; @@ -76,8 +77,10 @@ const FinalDecision: React.FC = ({ arbitrable }) => { const ruled = disputeDetails?.dispute?.ruled ?? false; const periodIndex = Periods[disputeDetails?.dispute?.period ?? "evidence"]; const navigate = useNavigate(); - // TODO block - const { data: currentRulingArray } = useReadKlerosCoreCurrentRuling({ args: [BigInt(id ?? 0)] }); + const { data: currentRulingArray } = useReadKlerosCoreCurrentRuling({ + query: { refetchInterval: REFETCH_INTERVAL }, + args: [BigInt(id ?? 0)], + }); const currentRuling = Number(currentRulingArray?.[0]); const answer = populatedDisputeData?.answers?.[currentRuling! - 1]; const buttonText = useMemo(() => { diff --git a/web/src/consts/index.ts b/web/src/consts/index.ts index db1fce13c..287a7b131 100644 --- a/web/src/consts/index.ts +++ b/web/src/consts/index.ts @@ -6,7 +6,7 @@ export { ArbitratorTypes }; export const ONE_BASIS_POINT = 10000n; -export const REFETCH_INTERVAL = 10000; +export const REFETCH_INTERVAL = 5000; export const IPFS_GATEWAY = import.meta.env.REACT_APP_IPFS_GATEWAY || "https://cdn.kleros.link"; export const HERMES_TELEGRAM_BOT_URL = diff --git a/web/src/hooks/useVotingContext.tsx b/web/src/hooks/useVotingContext.tsx index 33bc5392c..fa92bf09c 100644 --- a/web/src/hooks/useVotingContext.tsx +++ b/web/src/hooks/useVotingContext.tsx @@ -3,6 +3,7 @@ import React, { useContext, createContext, useMemo } from "react"; import { useParams } from "react-router-dom"; import { useAccount } from "wagmi"; +import { REFETCH_INTERVAL } from "consts/index"; import { useReadDisputeKitClassicIsVoteActive } from "hooks/contracts/generated"; import { useDisputeDetailsQuery } from "hooks/queries/useDisputeDetailsQuery"; import { useDrawQuery } from "hooks/queries/useDrawQuery"; @@ -34,10 +35,10 @@ export const VotingContextProvider: React.FC<{ children: React.ReactNode }> = ({ const { data: drawData, isLoading } = useDrawQuery(address?.toLowerCase(), id, disputeData?.dispute?.currentRound.id); const roundId = disputeData?.dispute?.currentRoundIndex; const voteId = drawData?.draws?.[0]?.voteIDNum; - // TODO watch const { data: hasVoted } = useReadDisputeKitClassicIsVoteActive({ query: { enabled: !isUndefined(roundId) && !isUndefined(voteId), + refetchInterval: REFETCH_INTERVAL, }, args: [BigInt(id ?? 0), roundId, voteId], }); diff --git a/web/src/pages/Resolver/Parameters/Jurors.tsx b/web/src/pages/Resolver/Parameters/Jurors.tsx index e2c1bc20a..189a49611 100644 --- a/web/src/pages/Resolver/Parameters/Jurors.tsx +++ b/web/src/pages/Resolver/Parameters/Jurors.tsx @@ -40,7 +40,6 @@ const StyledDisplay = styled(DisplaySmall)` const Jurors: React.FC = () => { const { disputeData, setDisputeData } = useNewDisputeContext(); - const { data } = useReadKlerosCoreArbitrationCost({ query: { enabled: !isUndefined(disputeData.numberOfJurors) && !Number.isNaN(disputeData.numberOfJurors),