File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ export default function ChallengeHeader(props) {
71
71
numRegistrants,
72
72
numSubmissions,
73
73
appealsEndDate,
74
+ status,
74
75
} = challenge ;
75
76
76
77
const { track } = legacy ;
@@ -79,7 +80,6 @@ export default function ChallengeHeader(props) {
79
80
80
81
const allPhases = challenge . phases || [ ] ;
81
82
const { prizes } = prizeSets && prizeSets . length ? prizeSets [ 0 ] : [ ] ;
82
- const status = allPhases . length ? allPhases [ 0 ] . name : '' ;
83
83
84
84
const checkpointPrizes = _ . find ( prizeSets , { type : 'checkpoint' } ) ;
85
85
let numberOfCheckpointsPrizes = 0 ;
@@ -125,8 +125,8 @@ export default function ChallengeHeader(props) {
125
125
*/
126
126
const hasSubmissions = userDetails && ( userDetails . submissions || [ ] ) . reduce ( ( acc , submission ) => acc || submission . status !== 'Deleted' , false ) ;
127
127
128
- let nextPhase = ( allPhases && allPhases [ 0 ] ) || { } ;
129
- if ( hasRegistered && nextPhase && nextPhase . name === 'Registration' ) {
128
+ let nextPhase = allPhases . filter ( p => p . name !== 'Registration' && p . isOpen ) . sort ( ( a , b ) => moment ( a . scheduledEndDate ) . diff ( b . scheduledEndDate ) ) [ 0 ] ;
129
+ if ( hasRegistered && allPhases [ 0 ] && allPhases [ 0 ] . name === 'Registration' ) {
130
130
nextPhase = allPhases [ 1 ] || { } ;
131
131
}
132
132
const nextDeadline = nextPhase && nextPhase . name ;
You can’t perform that action at this time.
0 commit comments