From d1ce6ae5bb5cc6624f3dbefcba3eb17635053199 Mon Sep 17 00:00:00 2001 From: Nursoltan Saipolda Date: Mon, 15 Jun 2020 10:07:59 +0800 Subject: [PATCH] fix error on registration page --- .../components/challenge-detail/Registrants/index.jsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/shared/components/challenge-detail/Registrants/index.jsx b/src/shared/components/challenge-detail/Registrants/index.jsx index fb9b4132c2..b78fc671a4 100644 --- a/src/shared/components/challenge-detail/Registrants/index.jsx +++ b/src/shared/components/challenge-detail/Registrants/index.jsx @@ -239,7 +239,7 @@ export default class Registrants extends React.Component { onSortChange, } = this.props; const { - prizes, + prizeSets, legacy, } = challenge; const { track } = legacy; @@ -247,8 +247,10 @@ export default class Registrants extends React.Component { const { field, sort } = this.getRegistrantsSortParam(); const revertSort = (sort === 'desc') ? 'asc' : 'desc'; const isDesign = track.toLowerCase() === 'design'; - const isF2F = challenge.subTrack.indexOf('FIRST_2_FINISH') > -1; - const isBugHunt = challenge.subTrack.indexOf('BUG_HUNT') > -1; + const isF2F = track.indexOf('FIRST_2_FINISH') > -1; + const isBugHunt = track.indexOf('BUG_HUNT') > -1; + const placementPrizes = _.find(prizeSets, { type: 'placement' }); + const { prizes } = placementPrizes || []; const checkpoints = challenge.checkpoints || []; @@ -491,7 +493,7 @@ Registrants.propTypes = { track: PT.any, }), subTrack: PT.any, - prizes: PT.arrayOf(PT.number).isRequired, + prizeSets: PT.arrayOf(PT.shape()).isRequired, registrants: PT.arrayOf(PT.shape()).isRequired, round1Introduction: PT.string, round2Introduction: PT.string,