This repository was archived by the owner on Mar 4, 2025. It is now read-only.
File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 179
179
// TODO placement logic for challenges can be moved to their corresponding user place directive
180
180
// process placement for challenges having winningPlacements array in response
181
181
if ( Array . isArray ( challenge . userDetails . winningPlacements ) ) {
182
- challenge . highestPlacement = _ . max ( challenge . userDetails . winningPlacements ) ;
182
+ challenge . highestPlacement = _ . min ( challenge . userDetails . winningPlacements ) ;
183
183
challenge . wonFirst = challenge . highestPlacement == 1 ;
184
184
if ( challenge . highestPlacement === 0 ) {
185
185
challenge . highestPlacement = null ;
189
189
if ( challenge . track == 'DESIGN' && challenge . userDetails . submissions && challenge . userDetails . submissions . length > 0 ) {
190
190
challenge . thumbnailId = challenge . userDetails . submissions [ 0 ] . id ;
191
191
192
- challenge . highestPlacement = _ . max ( challenge . userDetails . submissions , 'placement' ) . placement ;
192
+ challenge . highestPlacement = _ . min ( challenge . userDetails . submissions . filter ( function ( submission ) {
193
+ return submission . placement ;
194
+ } ) , 'placement' ) . placement ;
193
195
194
196
if ( challenge . highestPlacement == 1 ) {
195
197
challenge . wonFirst = true ;
You can’t perform that action at this time.
0 commit comments