@@ -116,7 +116,7 @@ class SubTrackChallengeView extends React.Component {
116
116
this . state = {
117
117
// this is current page number. starts with 0.
118
118
// everytime we scroll at the bottom, we query from offset = pageNum * CHALLENGE_PER_PAGE
119
- pageNum : 0 ,
119
+ pageNum : 1 ,
120
120
// which challenge's modal should be poped. null means no modal
121
121
challengeIndexToPopModal : null ,
122
122
} ;
@@ -140,6 +140,10 @@ class SubTrackChallengeView extends React.Component {
140
140
userId,
141
141
} = this . props ;
142
142
143
+ const {
144
+ pageNum,
145
+ } = this . state ;
146
+
143
147
if ( track === 'DEVELOP' || track === 'DESIGN' ) {
144
148
if ( ! loadingSubTrackChallengesUUID ) {
145
149
loadSubtrackChallenges (
@@ -159,7 +163,7 @@ class SubTrackChallengeView extends React.Component {
159
163
}
160
164
} else if ( subTrack === 'MARATHON_MATCH' ) {
161
165
if ( ! loadingMarathonUUID ) {
162
- loadMarathon ( handle , auth . tokenV3 , 0 , CHALLENGE_PER_PAGE , true ) ;
166
+ loadMarathon ( handle , userId , auth . tokenV3 , pageNum , CHALLENGE_PER_PAGE , true ) ;
163
167
}
164
168
}
165
169
}
@@ -209,7 +213,7 @@ class SubTrackChallengeView extends React.Component {
209
213
}
210
214
} else if ( subTrack === 'MARATHON_MATCH' ) {
211
215
if ( ! loadingMarathonUUID ) {
212
- loadMarathon ( handle , auth . tokenV3 , pageNum + 1 , CHALLENGE_PER_PAGE , false ) ;
216
+ loadMarathon ( handle , userId , auth . tokenV3 , pageNum + 1 , CHALLENGE_PER_PAGE , false ) ;
213
217
this . setState ( { pageNum : pageNum + 1 } ) ;
214
218
}
215
219
}
@@ -347,7 +351,6 @@ class SubTrackChallengeView extends React.Component {
347
351
userMarathons ,
348
352
item => ( {
349
353
...item ,
350
- submissionEndDate : _ . get ( item , 'rounds.0.systemTestEndAt' ) ,
351
354
pointTotal : _ . get ( item , 'rounds.0.userMMDetails.pointTotal' ) ,
352
355
} ) ,
353
356
) ;
@@ -440,10 +443,18 @@ function mapDispatchToProps(dispatch) {
440
443
dispatch ( action . getUserSrmInit ( handle , uuid ) ) ;
441
444
dispatch ( action . getUserSrmDone ( uuid , handle , tokenV3 , pageNum , pageSize , refresh ) ) ;
442
445
} ,
443
- loadMarathon : ( handle , tokenV3 , pageNum , pageSize , refresh ) => {
446
+ loadMarathon : ( handle , memberId , tokenV3 , pageNum , pageSize , refresh ) => {
444
447
const uuid = shortId ( ) ;
445
448
dispatch ( action . getUserMarathonInit ( handle , uuid ) ) ;
446
- dispatch ( action . getUserMarathonDone ( uuid , handle , tokenV3 , pageNum , pageSize , refresh ) ) ;
449
+ dispatch ( action . getUserMarathonDone (
450
+ uuid ,
451
+ handle ,
452
+ memberId ,
453
+ tokenV3 ,
454
+ pageNum ,
455
+ pageSize ,
456
+ refresh ,
457
+ ) ) ;
447
458
} ,
448
459
} ;
449
460
}
0 commit comments