Skip to content

Conversation

@ordinaryname
Copy link
Contributor

When all types of contests (design, develepment, data science) are unselected the page should load all contests, but instead it loads it tries to search for and load no contests. It tries again over and over for a few minutes and eventually stops trying.

I added an if statement in the 'removeTracks' function to delete the 'tracks' field similar to what was done in the 'addTracks' function when all tracks are selected. In the comments in the code it said that selecting all tracks is the same as having no tracks field. So selecting no tracks should also be the same.

When all tracks are removed the tracks field becomes an empty array which seems to cause the problem. Deleting the tracks array (field) makes the other functions behave as they should and return all challenges.

local.topcoder.com/challenges?

@birdofpreyru
Copy link
Collaborator

@ordinaryname No, it leads to incorrect logic: we disable all tracks, but we see all challenges. I would expect, that disabling all tracks shows no challenges. An easy way to achieve that is to modify https://github.com/topcoder-platform/community-app/blob/develop/src/shared/utils/challenge-listing/filter.js#L302
add there a check if tracks filter is present, but empty return as the result the object

{
  groupIds: '0',
}

With this, when all tracks are disabled, the backend will be called with backend filter for challenges from group 0, but there is no such group, so we'll get 0 challenges in the response immediately > no flickering. Just double-check, that this actually works :)

@ordinaryname
Copy link
Contributor Author

It works. I submitted a new pull request ( #415 ) starting fresh with a new clone of the develop branch and adding the check of the tracks filter.

@ordinaryname ordinaryname deleted the fixed_issue_176 branch August 30, 2017 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants