Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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 @@ const Jurors: React.FC = () => {
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 @@ const Jurors: React.FC = () => {
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)) {
setDisputeData({ ...disputeData, numberOfJurors: 0 });
} else {
setDisputeData({ ...disputeData, numberOfJurors: value });
}
};

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