File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 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);
9999export const useOptionsContext = ( ) => useContext ( OptionsContext ) ;
100100
101101const 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 ] ;
107111} ;
108112
109113const getPaidFees = ( dispute ?: ClassicAppealQuery [ "dispute" ] ) => {
You can’t perform that action at this time.
0 commit comments