Skip to content

Commit beaf57a

Browse files
Merge pull request #4908 from topcoder-platform/issue-2069
Profile Stats Challenges : Fix loading icon
2 parents 8ac5916 + 8a80704 commit beaf57a

File tree

1 file changed

+6
-7
lines changed
  • src/shared/components/ProfilePage/Stats/SubTrackChallengeView

1 file changed

+6
-7
lines changed

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

+6-7
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,8 @@ const processPastChallenge = (challenge) => {
111111
class SubTrackChallengeView extends React.Component {
112112
constructor(props, context) {
113113
super(props, context);
114-
// this is current page number. starts with 0.
115-
// everytime we scroll at the bottom, we query from offset = pageNum * CHALLENGE_PER_PAGE
116114
this.state = {
117-
// this is current page number. starts with 0.
115+
// this is current page number. starts with 1.
118116
// everytime we scroll at the bottom, we query from offset = pageNum * CHALLENGE_PER_PAGE
119117
pageNum: 1,
120118
// which challenge's modal should be poped. null means no modal
@@ -150,7 +148,7 @@ class SubTrackChallengeView extends React.Component {
150148
handle,
151149
auth.tokenV3,
152150
track, subTrack,
153-
0,
151+
pageNum,
154152
CHALLENGE_PER_PAGE,
155153
true,
156154
userId,
@@ -159,7 +157,8 @@ class SubTrackChallengeView extends React.Component {
159157
} else if (track === 'DATA_SCIENCE') {
160158
if (subTrack === 'SRM') {
161159
if (!loadingSRMUUID) {
162-
loadSRM(handle, auth.tokenV3, 0, CHALLENGE_PER_PAGE, true);
160+
// pageNum - 1 to match with v4 offset
161+
loadSRM(handle, auth.tokenV3, pageNum - 1, CHALLENGE_PER_PAGE, true);
163162
}
164163
} else if (subTrack === 'MARATHON_MATCH') {
165164
if (!loadingMarathonUUID) {
@@ -208,7 +207,7 @@ class SubTrackChallengeView extends React.Component {
208207
} else if (track === 'DATA_SCIENCE') {
209208
if (subTrack === 'SRM') {
210209
if (!loadingSRMUUID) {
211-
loadSRM(handle, auth.tokenV3, pageNum + 1, CHALLENGE_PER_PAGE, false);
210+
loadSRM(handle, auth.tokenV3, pageNum, CHALLENGE_PER_PAGE, false);
212211
this.setState({ pageNum: pageNum + 1 });
213212
}
214213
} else if (subTrack === 'MARATHON_MATCH') {
@@ -249,7 +248,7 @@ class SubTrackChallengeView extends React.Component {
249248
userId,
250249
} = this.props;
251250

252-
if (pageNum === 0
251+
if (pageNum === 1
253252
&& (loadingSubTrackChallengesUUID || loadingSRMUUID || loadingMarathonUUID)) {
254253
return <LoadingIndicator />;
255254
}

0 commit comments

Comments
 (0)