daily-code
daily-code copied to clipboard
Fix: Sort By not working properly (#716)
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
Edit the filterTracks Fun in Tracks.tsx
@devsargam can you review the pr