daily-code icon indicating copy to clipboard operation
daily-code copied to clipboard

Fix: Sort By not working properly (#716)

Open MrBlackGhostt opened this issue 9 months ago • 2 comments

PR Fixes:

  • 1 Fixes issue #716: "Sort By not working properly"
  • 2

Resolves #[716]

##Change Made

The issue occurred because some tracks had t.cohort === 0, which caused them to be excluded when selecting either cohort 2 or 3. I updated the condition so that when "All" is selected in Sort, selectedCohort becomes null. This ensures the condition evaluates to true for all cohorts when sorting by "All".

https://github.com/user-attachments/assets/79bb77c4-e5f7-40e5-883a-cbb5448dd86d

https://github.com/user-attachments/assets/820bd972-0f29-4ae9-9980-b50ddfa7f2d4

All Track have t.cohort = 0 that's why on selecting the cohort nothing shows

Checklist before requesting a review

  • [x] I have performed a self-review of my code
  • [x] I assure there is no similar/duplicate pull request regarding same issue

MrBlackGhostt avatar Feb 17 '25 17:02 MrBlackGhostt

Edit the filterTracks Fun in Tracks.tsx

MrBlackGhostt avatar Feb 17 '25 17:02 MrBlackGhostt

@devsargam can you review the pr

MrBlackGhostt avatar Feb 17 '25 18:02 MrBlackGhostt