Skip to content
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

Respect URL params & display correct bucket content #56

Merged
merged 1 commit into from
May 6, 2023

Conversation

StarsbySea
Copy link
Contributor

@StarsbySea StarsbySea commented May 4, 2023

Closes #55

This commit addresses two main issues in the search and bucket components. Firstly, it ensures that search parameters from the URL are respected, and secondly, it allows correct display of bucket content when clicking on non-official repositories.

Changes made:

  1. In Search.tsx, modified the code to read and set sortIndex, sortDirection, and searchOfficialOnly from the URL parameters using getSortIndexFromSearchParams, getSortDirectionFromSearchParams, and getSearchOfficialOnlyFromSearchParams, respectively.
  2. Updated handleSortChange and handleSearchOfficialOnlyChange to set the respective state variables directly, instead of updating the URL parameters first.
  3. In Buckets.tsx, changed the 'search' property of the 'Link' component to include the official flag in the query parameters, ensuring that the bucket content is displayed correctly for non-official repositories.

This commit addresses two main issues in the search and bucket components. Firstly, it ensures that search parameters from the URL are respected, and secondly, it allows correct display of bucket content when clicking on non-official repositories.

Changes made:

1. In Search.tsx, modified the code to read and set sortIndex, sortDirection, and searchOfficialOnly from the URL parameters using getSortIndexFromSearchParams, getSortDirectionFromSearchParams, and getSearchOfficialOnlyFromSearchParams, respectively.
2. Updated handleSortChange and handleSearchOfficialOnlyChange to set the respective state variables directly, instead of updating the URL parameters first.
3. In Buckets.tsx, changed the 'search' property of the 'Link' component to include the official flag in the query parameters, ensuring that the bucket content is displayed correctly for non-official repositories.
@gpailler
Copy link
Collaborator

gpailler commented May 6, 2023

Looks good thanks 👍
I'll merge to main and will deploy soon

@gpailler gpailler merged commit 6d45590 into ScoopInstaller:main May 6, 2023
3 checks passed
@StarsbySea StarsbySea deleted the search-bug-fix branch May 6, 2023 10:13
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.

Bug: No results found when clicking on a non-official bucket for the first time
2 participants