Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgasper committed Apr 7, 2024
1 parent 4b7d1f9 commit ab42859
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 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,10 +133,10 @@ 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
*/
getSubmissionDate(registrant, statisticsData) {
static getSubmissionDate(registrant, data) {
let submissionDate;
const statistic = (statisticsData || []).find(x => x.handle === registrant.memberHandle)
if(statistic && statistic.submissions && statistic.submissions.length>0){
const statistic = (data || []).find(x => x.handle === registrant.memberHandle);
if (statistic && statistic.submissions && statistic.submissions.length > 0) {
submissionDate = statistic.submissions.sort()[0].created;
}
return submissionDate;
Expand Down Expand Up @@ -428,8 +429,8 @@ export default class Registrants extends React.Component {
checkpoint = formatDate(checkpoint);
}
let final = this.getFinal(r);
if(!final){
final = this.getSubmissionDate(r, statisticsData);
if (!final) {
final = this.getSubmissionDate(r, statisticsData);
}

return (
Expand Down Expand Up @@ -540,7 +541,7 @@ Registrants.propTypes = {
type: PT.string,
track: PT.string,
}).isRequired,
statisticsData: PT.arrayOf(PT.shape()),
statisticsData: PT.arrayOf(PT.shape()).isRequired,
results: PT.arrayOf(PT.shape()),
checkpointResults: PT.shape(),
registrants: PT.arrayOf(PT.shape()),
Expand Down

0 comments on commit ab42859

Please sign in to comment.