This repository was archived by the owner on Mar 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-10
lines changed
app/my-dashboard/subtrack-stats Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change 51
51
} , [ ] ) ;
52
52
}
53
53
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
+ }
62
70
} else {
63
- subtrack . stat = subtrack . rating ;
64
- subtrack . statType = 'Rating' ;
71
+ rank . stat = rank . rating ;
72
+ rank . statType = 'Rating' ;
65
73
}
66
74
} ) ;
67
75
}
You can’t perform that action at this time.
0 commit comments