Skip to content

Commit 06f0b30

Browse files
authored
Merge pull request #4638 from narekcat/issue-4637
fix: issue 4637, next phase detail shows corret in my submissions page
2 parents 90e4189 + 3e56e4e commit 06f0b30

File tree

1 file changed

+4
-2
lines changed
  • src/shared/components/SubmissionManagement/SubmissionManagement

1 file changed

+4
-2
lines changed

src/shared/components/SubmissionManagement/SubmissionManagement/index.jsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ export default function SubmissionManagement(props) {
4545

4646
const isDesign = challengeType === 'design';
4747
const isDevelop = challengeType === 'develop';
48-
const currentPhase = _.find(challenge.phases || [], { isOpen: true });
48+
const currentPhase = challenge.phases
49+
.filter(p => p.name !== 'Registration' && p.isOpen)
50+
.sort((a, b) => moment(a.scheduledEndDate).diff(b.scheduledEndDate))[0];
4951

5052
const now = moment();
5153
const end = moment(currentPhase.scheduledEndDate);
52-
const diff = end.diff(now);
54+
const diff = end.isAfter(now) ? end.diff(now) : 0;
5355
const timeLeft = moment.duration(diff);
5456

5557
const [days, hours, minutes] = [

0 commit comments

Comments
 (0)