Skip to content

Commit

Permalink
fix: Reset page on tag change (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
evadecker committed Nov 22, 2023
1 parent fa7a205 commit d42aa9e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
const handleSearch: FormEventHandler<HTMLInputElement> = (e) => {
currentQuery = e.currentTarget.value;
const newURL = new URL($page.url);
newURL.searchParams.delete('page');
if (currentQuery) {
newURL.searchParams.set('q', currentQuery);
Expand All @@ -64,6 +65,7 @@
const handleTagClick = (tag: Enums<'tags'> | null) => {
const newURL = new URL($page.url);
newURL.searchParams.delete('page');
if (currentTag === tag || tag === null) {
newURL.searchParams.delete('tag');
Expand Down

0 comments on commit d42aa9e

Please sign in to comment.