Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #22 from pvdthings/QueryParamWishList
Browse files Browse the repository at this point in the history
Add query params for showWishList
  • Loading branch information
dillonfagan authored May 31, 2023
2 parents 9661e4a + 6482698 commit 843240a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import EyeOffIcon from "$lib/icons/eye-off.svg";
import EyeIcon from "$lib/icons/eye.svg";
import { t } from "$lib/language/translate";
import { goto } from '$app/navigation';
export let data;
Expand All @@ -17,7 +18,11 @@
let searchText = "";
let showingOnlyWishList = false;
onMount(() => filterThings());
onMount(() => {
const urlParams = new URLSearchParams(window.location.search);
showingOnlyWishList = urlParams.get('showWishList') === 'true';
filterThings();
});
const filterThings = () => {
shownThings = filter(data.things, {
Expand All @@ -34,6 +39,7 @@
const toggleWishList = () => {
showingOnlyWishList = !showingOnlyWishList;
goto(`?showWishList=${showingOnlyWishList}`);
filterThings();
}
</script>
Expand Down

1 comment on commit 843240a

@vercel
Copy link

@vercel vercel bot commented on 843240a May 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

app – ./

app-git-main-pvdthings.vercel.app
app-pvdthings.vercel.app
app-nine-delta.vercel.app

Please sign in to comment.