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

Commit 0f4d00c

Browse files
author
vikasrohit
committed
SUP-2387, Dealing with stats for design and non-rated sub-tracks
-- Handled the submissions count be fetched directly from subtract object instead of looking into nested submissions object for design track.
1 parent 2ae4800 commit 0f4d00c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/profile/profile.controller.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@
4646
vm.numWins = vm.stats.wins;
4747
vm.categories = ProfileService.getRanks(vm.stats);
4848
for(var trackName in vm.categories) {
49-
var subTracks = vm.categories[trackName];
49+
// trackStats is an array of subtrack rankings along with track stats properties (e.g showTrack)
5050
var trackStats = vm.categories[trackName];
5151
trackStats.showTrack = false;
52-
if (subTracks && subTracks.length > 0) {
53-
subTracks.forEach(function(subTrackRank) {
52+
if (trackStats && trackStats.length > 0) {
53+
trackStats.forEach(function(subTrackRank) {
5454
UserStatsService.processStatRank(subTrackRank);
5555
if (subTrackRank.showStats) {
5656
trackStats.showTrack = true;

app/services/profile.service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
'rank': false,
124124
'challenges': subTrack.challenges,
125125
'wins': subTrack.wins,
126-
'submissions': (subTrack.submissions && subTrack.submissions.submissions) || 0,
126+
'submissions': (subTrack.submissions) || 0,
127127
'mostRecentEventDate': new Date(subTrack.mostRecentEventDate)
128128
};
129129
});

0 commit comments

Comments
 (0)