Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 1776549

Browse files
author
Dushyant Bhalgami
committed
fixed sorting for the f2f
1 parent 037eb9a commit 1776549

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pages/f2f-leaderboard.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ class F2FLeaderboard extends React.Component {
124124
prepareLeaderboard(this.props.challengeId, this.props.members, this.props.groupId, this.props.challengeIds, this.props.isF2f)
125125
.then((leaderboard) => {
126126
if (this.props.isF2f) {
127+
leaderboard.sort((a, b) => (b.points - a.points))
128+
127129
if (this.props.showFinalScore) {
128130
leaderboard.forEach(l => { l.reveal = false })
129131
this.setState({ leaderboard })
@@ -139,6 +141,7 @@ class F2FLeaderboard extends React.Component {
139141
// - have only 2 columns, 1 for points and 1 for tests
140142
// - have 2 types of scores, provisional and final
141143

144+
console.log(leaderboard)
142145
// Check if all members have their final scores ready for animation
143146
const finalResultsAvailable = leaderboard.every(l => {
144147
let hasScore = false

0 commit comments

Comments
 (0)