File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -99,11 +99,15 @@ export const useFundingContext = () => useContext(FundingContext);
99
99
export const useOptionsContext = ( ) => useContext ( OptionsContext ) ;
100
100
101
101
const getCurrentLocalRound = ( dispute ?: ClassicAppealQuery [ "dispute" ] ) => {
102
- const period = dispute ?. period ;
103
- const currentLocalRoundIndex = dispute ?. disputeKitDispute ?. currentLocalRoundIndex ;
104
- return getLocalRounds ( dispute ?. disputeKitDispute ) [
105
- [ "appeal" , "execution" ] . includes ( period ?? "" ) ? currentLocalRoundIndex : currentLocalRoundIndex - 1
106
- ] ;
102
+ if ( ! dispute ) return undefined ;
103
+
104
+ const period = dispute . period ;
105
+ const currentLocalRoundIndex = dispute . disputeKitDispute ?. currentLocalRoundIndex ;
106
+ const adjustedRoundIndex = [ "appeal" , "execution" ] . includes ( period )
107
+ ? currentLocalRoundIndex
108
+ : currentLocalRoundIndex - 1 ;
109
+
110
+ return getLocalRounds ( dispute . disputeKitDispute ) [ adjustedRoundIndex ] ;
107
111
} ;
108
112
109
113
const getPaidFees = ( dispute ?: ClassicAppealQuery [ "dispute" ] ) => {
You can’t perform that action at this time.
0 commit comments