Skip to content

Commit

Permalink
fix(web): crashing appeal tab
Browse files Browse the repository at this point in the history
  • Loading branch information
kemuru committed Oct 20, 2023
1 parent 34fa822 commit 0ff85f8
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions web/src/hooks/useClassicAppealContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,15 @@ export const useFundingContext = () => useContext(FundingContext);
export const useOptionsContext = () => useContext(OptionsContext);

const getCurrentLocalRound = (dispute?: ClassicAppealQuery["dispute"]) => {
const period = dispute?.period;
const currentLocalRoundIndex = dispute?.disputeKitDispute?.currentLocalRoundIndex;
return getLocalRounds(dispute?.disputeKitDispute)[
["appeal", "execution"].includes(period ?? "") ? currentLocalRoundIndex : currentLocalRoundIndex - 1
];
if (!dispute) return undefined;

const period = dispute.period;
const currentLocalRoundIndex = dispute.disputeKitDispute?.currentLocalRoundIndex;
const adjustedRoundIndex = ["appeal", "execution"].includes(period)
? currentLocalRoundIndex
: currentLocalRoundIndex - 1;

return getLocalRounds(dispute.disputeKitDispute)[adjustedRoundIndex];
};

const getPaidFees = (dispute?: ClassicAppealQuery["dispute"]) => {
Expand Down

0 comments on commit 0ff85f8

Please sign in to comment.