Skip to content

Commit 7a78b27

Browse files
committed
chore: rabbit-feedback
1 parent 8b6e1f9 commit 7a78b27

File tree

1 file changed

+5
-4
lines changed
  • web/src/pages/Cases/CaseDetails/Voting/Classic

1 file changed

+5
-4
lines changed

web/src/pages/Cases/CaseDetails/Voting/Classic/Reveal.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,12 @@ const getSaltAndChoice = async (
150150
const salt = keccak256(rawSalt);
151151

152152
// when dispute is invalid, just add RFA to the answers array
153-
if (answers.length === 0) {
154-
answers.unshift({ id: "0x0", title: "Refuse To Arbitrate", description: "Refuse To Arbitrate" });
155-
}
153+
const candidates =
154+
answers?.length > 0
155+
? answers
156+
: [{ id: "0x0", title: "Refuse To Arbitrate", description: "Refuse To Arbitrate" } as Answer];
156157

157-
const { choice } = answers.reduce<{ found: boolean; choice: bigint }>(
158+
const { choice } = candidates.reduce<{ found: boolean; choice: bigint }>(
158159
(acc, answer) => {
159160
if (acc.found) return acc;
160161
const innerCommit = keccak256(encodePacked(["uint256", "uint256"], [BigInt(answer.id), BigInt(salt)]));

0 commit comments

Comments
 (0)