Skip to content

Profile Stats Challenges : Fix loading icon #4908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,8 @@ const processPastChallenge = (challenge) => {
class SubTrackChallengeView extends React.Component {
constructor(props, context) {
super(props, context);
// this is current page number. starts with 0.
// everytime we scroll at the bottom, we query from offset = pageNum * CHALLENGE_PER_PAGE
this.state = {
// this is current page number. starts with 0.
// this is current page number. starts with 1.
// everytime we scroll at the bottom, we query from offset = pageNum * CHALLENGE_PER_PAGE
pageNum: 1,
// which challenge's modal should be poped. null means no modal
Expand Down Expand Up @@ -150,7 +148,7 @@ class SubTrackChallengeView extends React.Component {
handle,
auth.tokenV3,
track, subTrack,
0,
pageNum,
CHALLENGE_PER_PAGE,
true,
userId,
Expand All @@ -159,7 +157,8 @@ class SubTrackChallengeView extends React.Component {
} else if (track === 'DATA_SCIENCE') {
if (subTrack === 'SRM') {
if (!loadingSRMUUID) {
loadSRM(handle, auth.tokenV3, 0, CHALLENGE_PER_PAGE, true);
// pageNum - 1 to match with v4 offset
loadSRM(handle, auth.tokenV3, pageNum - 1, CHALLENGE_PER_PAGE, true);
}
} else if (subTrack === 'MARATHON_MATCH') {
if (!loadingMarathonUUID) {
Expand Down Expand Up @@ -208,7 +207,7 @@ class SubTrackChallengeView extends React.Component {
} else if (track === 'DATA_SCIENCE') {
if (subTrack === 'SRM') {
if (!loadingSRMUUID) {
loadSRM(handle, auth.tokenV3, pageNum + 1, CHALLENGE_PER_PAGE, false);
loadSRM(handle, auth.tokenV3, pageNum, CHALLENGE_PER_PAGE, false);
this.setState({ pageNum: pageNum + 1 });
}
} else if (subTrack === 'MARATHON_MATCH') {
Expand Down Expand Up @@ -249,7 +248,7 @@ class SubTrackChallengeView extends React.Component {
userId,
} = this.props;

if (pageNum === 0
if (pageNum === 1
&& (loadingSubTrackChallengesUUID || loadingSRMUUID || loadingMarathonUUID)) {
return <LoadingIndicator />;
}
Expand Down