From ab42859a1b8ce60c3b26fa8a99aa2eb1122d5f4a Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Sun, 7 Apr 2024 03:25:51 +0000 Subject: [PATCH] Lint --- .../challenge-detail/Registrants/index.jsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/shared/components/challenge-detail/Registrants/index.jsx b/src/shared/components/challenge-detail/Registrants/index.jsx index 5b8530573..37629fb6c 100644 --- a/src/shared/components/challenge-detail/Registrants/index.jsx +++ b/src/shared/components/challenge-detail/Registrants/index.jsx @@ -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); @@ -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; @@ -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 ( @@ -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()),