Skip to content

Commit 7e7a4f5

Browse files
fix(web): verdict-answer-decoding
1 parent 3e1118d commit 7e7a4f5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

web/src/components/Verdict/FinalDecision.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const FinalDecision: React.FC<IFinalDecision> = ({ arbitrable }) => {
9999
chainId: DEFAULT_CHAIN,
100100
});
101101
const currentRuling = Number(currentRulingArray?.[0]);
102-
const answer = populatedDisputeData?.answers?.[currentRuling! - 1];
102+
const answer = populatedDisputeData?.answers?.find((answer) => BigInt(answer.id) === BigInt(currentRuling ?? 0));
103103
const rounds = votingHistory?.dispute?.rounds;
104104
const jurorRewardsDispersed = useMemo(() => Boolean(rounds?.every((round) => round.jurorRewardsDispersed)), [rounds]);
105105
const buttonText = useMemo(() => {

web/src/hooks/useClassicAppealContext.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ const getCurrentLocalRound = (dispute?: ClassicAppealQuery["dispute"]) => {
133133
};
134134

135135
const getOptions = (dispute?: DisputeDetails, classicDispute?: ClassicAppealQuery["dispute"]) => {
136-
if (!dispute) return [];
136+
if (!dispute || Object.keys(dispute).length === 0) return [];
137137
const currentLocalRound = getCurrentLocalRound(classicDispute);
138138
const classicAnswers = currentLocalRound?.answers;
139139

140-
const options = dispute.answers.map((answer) => {
140+
const options = dispute.answers?.map((answer) => {
141141
const classicAnswer = classicAnswers?.find((classicAnswer) => BigInt(classicAnswer.answerId) == BigInt(answer.id));
142142
// converting hexadecimal id to stringified bigint to match id fomr subgraph
143143
return {

0 commit comments

Comments
 (0)