Skip to content

Commit c086300

Browse files
Fix hasSubmissions in Challenge Details page
1 parent a6ad4a0 commit c086300

File tree

1 file changed

+1
-2
lines changed
  • src/shared/components/challenge-detail/Header

1 file changed

+1
-2
lines changed

src/shared/components/challenge-detail/Header/index.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ export default function ChallengeHeader(props) {
6868
legacy,
6969
prizeSets,
7070
reliabilityBonus,
71-
userDetails,
7271
numOfRegistrants,
7372
numOfSubmissions,
7473
appealsEndDate,
@@ -124,7 +123,7 @@ export default function ChallengeHeader(props) {
124123
* iterate through all their submissions and ensure that all of them
125124
* are Deleted
126125
*/
127-
const hasSubmissions = userDetails && (userDetails.submissions || []).reduce((acc, submission) => acc || submission.status !== 'Deleted', false);
126+
const hasSubmissions = !_.isEmpty(mySubmissions);
128127

129128
let nextPhase = allPhases.filter(p => p.name !== 'Registration' && p.isOpen).sort((a, b) => moment(a.scheduledEndDate).diff(b.scheduledEndDate))[0];
130129
if (hasRegistered && allPhases[0] && allPhases[0].name === 'Registration') {

0 commit comments

Comments
 (0)