Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
jaybuidl committed Oct 20, 2023
2 parents 3626a8e + 0ff85f8 commit 928d23b
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 928d23b

Please sign in to comment.