Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/src/pages/Resolver/NavigationButtons/NextButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const NextButton: React.FC<INextButton> = ({ nextRoute }) => {
(location.pathname.includes("/resolver/description") && !disputeData.description) ||
(location.pathname.includes("/resolver/court") &&
(!disputeData.courtId || !isGatedTokenValid || !disputeData.disputeKitId)) ||
(location.pathname.includes("/resolver/jurors") && !disputeData.arbitrationCost) ||
(location.pathname.includes("/resolver/jurors") && (!disputeData.arbitrationCost || !disputeData.numberOfJurors)) ||
(location.pathname.includes("/resolver/voting-options") && !areVotingOptionsFilled) ||
(location.pathname.includes("/resolver/notable-persons") && !areAliasesValidOrEmpty) ||
(location.pathname.includes("/resolver/policy") && (isPolicyUploading || !disputeData.policyURI));
Expand Down
9 changes: 7 additions & 2 deletions web/src/pages/Resolver/Parameters/Jurors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
enabled: !isUndefined(disputeData.numberOfJurors) && !Number.isNaN(disputeData.numberOfJurors),
refetchInterval: REFETCH_INTERVAL,
},
args: [prepareArbitratorExtradata(disputeData.courtId ?? "", disputeData.numberOfJurors ?? "0")],
args: [prepareArbitratorExtradata(disputeData.courtId ?? "", disputeData?.numberOfJurors ?? 0)],
chainId: DEFAULT_CHAIN,
});

Expand All @@ -67,7 +67,12 @@
useEffect(() => setDisputeData({ ...disputeData, arbitrationCost: data?.toString() }), [data]);

const handleJurorsWrite = (event: React.ChangeEvent<HTMLInputElement>) => {
setDisputeData({ ...disputeData, numberOfJurors: parseInt(event.target.value.replace(/\D/g, ""), 10) });
const value = parseInt(event.target.value.replace(/\D/g, ""), 10);
if (isUndefined(value) || isNaN(value)) {

Check warning on line 71 in web/src/pages/Resolver/Parameters/Jurors.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `Number.isNaN` over `isNaN`.

See more on https://sonarcloud.io/project/issues?id=kleros_kleros-v2&issues=AZr8WTJ-v78fvmSADFt2&open=AZr8WTJ-v78fvmSADFt2&pullRequest=2201
setDisputeData({ ...disputeData, numberOfJurors: 0 });
} else {
setDisputeData({ ...disputeData, numberOfJurors: value });
}
};

const noOfVotes = Number.isNaN(disputeData.numberOfJurors) ? "" : disputeData.numberOfJurors;
Expand Down
Loading