From 833161ebf45f6d9e898e0d2fafb4708f06368d8d Mon Sep 17 00:00:00 2001 From: "Dr. Sergey Pogodin" Date: Mon, 12 Jun 2017 21:12:44 +0200 Subject: [PATCH] Fix of challenge listing Format of MM objects returned by the backend has changed slightly, and it broke our frontend code. This is the fix. --- src/shared/reducers/challenge-listing.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/reducers/challenge-listing.js b/src/shared/reducers/challenge-listing.js index 03404a19ea..7aa223efa2 100644 --- a/src/shared/reducers/challenge-listing.js +++ b/src/shared/reducers/challenge-listing.js @@ -84,8 +84,8 @@ export function normalizeMarathonMatch(challenge) { currentPhases: allphases.filter(phase => phase.phaseStatus === 'Open'), communities: new Set([COMMUNITY.DATA_SCIENCE]), currentPhaseName: endTimestamp > Date.now() ? 'Registration' : '', - numRegistrants: challenge.numRegistrants[0], - numSubmissions: challenge.userIds.length, + numRegistrants: challenge.numRegistrants ? challenge.numRegistrants[0] : 0, + numSubmissions: challenge.userIds ? challenge.userIds.length : 0, platforms: '', prizes: [0], registrationOpen: endTimestamp > Date.now() ? 'Yes' : 'No',