Skip to content

Commit f0af65d

Browse files
Merge pull request #4893 from narekcat/issue-2069
fix: for issue #2069
2 parents fd0381a + 1c91948 commit f0af65d

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
"tc-accounts": "git+https://github.com/appirio-tech/accounts-app.git#dev",
138138
"tc-core-library-js": "github:appirio-tech/tc-core-library-js#v2.6.3",
139139
"tc-ui": "^1.0.12",
140-
"topcoder-react-lib": "1000.22.3",
140+
"topcoder-react-lib": "1000.22.5",
141141
"topcoder-react-ui-kit": "2.0.0",
142142
"topcoder-react-utils": "0.7.8",
143143
"turndown": "^4.0.2",

src/shared/components/ProfilePage/Stats/SubTrackChallengeView/index.jsx

+17-6
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)