Skip to content

Commit

Permalink
Bug fixes after lint made me break things
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgasper committed Apr 7, 2024
1 parent c81c9f0 commit f77c875
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/shared/components/challenge-detail/Registrants/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export default class Registrants extends React.Component {

this.getCheckPoint = this.getCheckPoint.bind(this);
this.getCheckPointDate = this.getCheckPointDate.bind(this);
this.getSubmissionDate = this.getSubmissionDate.bind(this);
this.getFlagFirstTry = this.getFlagFirstTry.bind(this);
this.sortRegistrants = this.sortRegistrants.bind(this);
this.getRegistrantsSortParam = this.getRegistrantsSortParam.bind(this);
Expand Down Expand Up @@ -132,9 +133,13 @@ export default class Registrants extends React.Component {
* Get the submission date of a registrant (used when viewing the registrants tab anonymously)
* @param {Object} registrant the registrant to return the submission date for
*/
static getSubmissionDate(registrant, data) {
getSubmissionDate(registrant) {
const {
statisticsData,
} = this.props;
console.log(JSON.stringify(statisticsData, null, 4));
let submissionDate;
const statistic = (data || []).find(x => x.handle === registrant.memberHandle);
const statistic = (statisticsData || []).find(x => x.handle === registrant.memberHandle);
if (statistic && statistic.submissions && statistic.submissions.length > 0) {
submissionDate = statistic.submissions.sort()[0].created;
}
Expand Down Expand Up @@ -257,7 +262,6 @@ export default class Registrants extends React.Component {
checkpointResults,
results,
onSortChange,
statisticsData,
} = this.props;
const {
prizeSets,
Expand Down Expand Up @@ -429,7 +433,7 @@ export default class Registrants extends React.Component {
}
let final = this.getFinal(r);
if (!final) {
final = this.getSubmissionDate(r, statisticsData);
final = this.getSubmissionDate(r);
}

return (
Expand Down

0 comments on commit f77c875

Please sign in to comment.