diff --git a/src/shared/components/challenge-listing/Tooltips/ProgressBarTooltip/index.jsx b/src/shared/components/challenge-listing/Tooltips/ProgressBarTooltip/index.jsx index 5d7af55ffe..65aac9c5f9 100644 --- a/src/shared/components/challenge-listing/Tooltips/ProgressBarTooltip/index.jsx +++ b/src/shared/components/challenge-listing/Tooltips/ProgressBarTooltip/index.jsx @@ -101,13 +101,13 @@ function Tip(props) { const submissionPhase = allPhases.find(phase => phase.name === 'Submission') || {}; const checkpointPhase = allPhases.find(phase => phase.name === 'Checkpoint Submission') || {}; - if (registrationPhase) { + if (!_.isEmpty(registrationPhase)) { steps.push({ date: phaseStartDate(registrationPhase), name: 'Start', }); } - if (checkpointPhase) { + if (!_.isEmpty(checkpointPhase)) { steps.push({ date: phaseEndDate(checkpointPhase), name: 'Checkpoint', @@ -119,7 +119,7 @@ function Tip(props) { date: phaseEndDate(iterativeReviewPhase), name: 'Iterative Review', }); - } else if (submissionPhase) { + } else if (!_.isEmpty(submissionPhase)) { steps.push({ date: phaseEndDate(submissionPhase), name: 'Submission', diff --git a/src/shared/utils/challenge-listing/sort.js b/src/shared/utils/challenge-listing/sort.js index 0f8d77a159..80b6d695d9 100644 --- a/src/shared/utils/challenge-listing/sort.js +++ b/src/shared/utils/challenge-listing/sort.js @@ -3,7 +3,7 @@ */ import moment from 'moment'; -import { find, sumBy } from 'lodash'; +import { find, sumBy, isEmpty } from 'lodash'; import { phaseStartDate, phaseEndDate } from './helper'; export const SORTS = { @@ -59,7 +59,7 @@ export default { const registrationPhase = find(challenge.phases, p => p.name === 'Registration') || {}; const submissionPhase = find(challenge.phases, p => p.name === 'Submission') || {}; // registration phase exists - if (registrationPhase) { + if (!isEmpty(registrationPhase)) { return moment(phaseStartDate(registrationPhase)); } // registration phase doesnt exist, This is possibly a F2F or TSK. Take submission phase