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

Commit 279df4f

Browse files
author
vikasrohit
committed
SUP-2386, Code and first to finish show ratings not wins
-- Fixed the ratings to show to show for CODE and FIRST_2_FINISH subtracks.
1 parent 3610c13 commit 279df4f

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

app/my-dashboard/subtrack-stats/subtrack-stats.controller.js

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,25 @@
5151
}, []);
5252
}
5353

54-
function processStats(subtrackRanks) {
55-
angular.forEach(subtrackRanks, function(subtrack) {
56-
if (subtrack.track === 'DESIGN') {
57-
subtrack.stat = subtrack.wins;
58-
subtrack.statType = 'Wins';
59-
} else if (subtrack.track === 'COPILOT') {
60-
subtrack.stat = subtrack.activeContests;
61-
subtrack.statType = 'Challenges';
54+
function processStats(ranks) {
55+
angular.forEach(ranks, function(rank) {
56+
if (rank.track === 'DESIGN') {
57+
rank.stat = rank.wins;
58+
rank.statType = 'Wins';
59+
} else if (rank.track === 'COPILOT') {
60+
rank.stat = rank.activeContests;
61+
rank.statType = 'Challenges';
62+
} else if (rank.track === 'DEVELOP') {
63+
if (['CODE', 'FIRST_2_FINISH'].indexOf(rank.subTrack) != -1) {
64+
rank.stat = rank.wins;
65+
rank.statType = 'Wins';
66+
} else {
67+
rank.stat = rank.rating;
68+
rank.statType = 'Rating';
69+
}
6270
} else {
63-
subtrack.stat = subtrack.rating;
64-
subtrack.statType = 'Rating';
71+
rank.stat = rank.rating;
72+
rank.statType = 'Rating';
6573
}
6674
});
6775
}

0 commit comments

Comments
 (0)