ScoopInstaller / scoopinstaller.github.io

ScoopInstaller homepage and search engine
https://scoop.sh
MIT License
81 stars 18 forks source link

Respect URL params & display correct bucket content #56

Closed StarsbySea closed 1 year ago

StarsbySea commented 1 year ago

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.
gpailler commented 1 year ago

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