@@ -116,7 +116,7 @@ class SubTrackChallengeView extends React.Component {
116116 this . state = {
117117 // this is current page number. starts with 0.
118118 // everytime we scroll at the bottom, we query from offset = pageNum * CHALLENGE_PER_PAGE
119- pageNum : 0 ,
119+ pageNum : 1 ,
120120 // which challenge's modal should be poped. null means no modal
121121 challengeIndexToPopModal : null ,
122122 } ;
@@ -140,6 +140,10 @@ class SubTrackChallengeView extends React.Component {
140140 userId,
141141 } = this . props ;
142142
143+ const {
144+ pageNum,
145+ } = this . state ;
146+
143147 if ( track === 'DEVELOP' || track === 'DESIGN' ) {
144148 if ( ! loadingSubTrackChallengesUUID ) {
145149 loadSubtrackChallenges (
@@ -159,7 +163,7 @@ class SubTrackChallengeView extends React.Component {
159163 }
160164 } else if ( subTrack === 'MARATHON_MATCH' ) {
161165 if ( ! loadingMarathonUUID ) {
162- loadMarathon ( handle , auth . tokenV3 , 0 , CHALLENGE_PER_PAGE , true ) ;
166+ loadMarathon ( handle , userId , auth . tokenV3 , pageNum , CHALLENGE_PER_PAGE , true ) ;
163167 }
164168 }
165169 }
@@ -209,7 +213,7 @@ class SubTrackChallengeView extends React.Component {
209213 }
210214 } else if ( subTrack === 'MARATHON_MATCH' ) {
211215 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 ) ;
213217 this . setState ( { pageNum : pageNum + 1 } ) ;
214218 }
215219 }
@@ -347,7 +351,6 @@ class SubTrackChallengeView extends React.Component {
347351 userMarathons ,
348352 item => ( {
349353 ...item ,
350- submissionEndDate : _ . get ( item , 'rounds.0.systemTestEndAt' ) ,
351354 pointTotal : _ . get ( item , 'rounds.0.userMMDetails.pointTotal' ) ,
352355 } ) ,
353356 ) ;
@@ -440,10 +443,18 @@ function mapDispatchToProps(dispatch) {
440443 dispatch ( action . getUserSrmInit ( handle , uuid ) ) ;
441444 dispatch ( action . getUserSrmDone ( uuid , handle , tokenV3 , pageNum , pageSize , refresh ) ) ;
442445 } ,
443- loadMarathon : ( handle , tokenV3 , pageNum , pageSize , refresh ) => {
446+ loadMarathon : ( handle , memberId , tokenV3 , pageNum , pageSize , refresh ) => {
444447 const uuid = shortId ( ) ;
445448 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+ ) ) ;
447458 } ,
448459 } ;
449460}
0 commit comments