From c35e87f6a7bb2e8e84d7ec2ac44b76fc127a97b3 Mon Sep 17 00:00:00 2001 From: Lawrence Forman Date: Wed, 19 Jun 2024 08:28:15 -0400 Subject: [PATCH] use sveltekit replaceState() --- src/routes/(app)/players/+page.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/(app)/players/+page.svelte b/src/routes/(app)/players/+page.svelte index 8df95c0..9507846 100644 --- a/src/routes/(app)/players/+page.svelte +++ b/src/routes/(app)/players/+page.svelte @@ -2,7 +2,7 @@ import Page from "$lib/components/page.svelte"; import { page } from "$app/stores"; import { zeroHash, type Address, type Hex } from "viem"; - import { goto } from "$app/navigation"; + import { goto, replaceState } from "$app/navigation"; import { browser } from "$app/environment"; import { PUBLIC_DATA_URL } from "$env/static/public"; import Lede from "$lib/components/lede.svelte"; @@ -39,7 +39,7 @@ const querySortBy = $page.url.searchParams.get('sortBy'); if (sortBy && querySortBy !== sortBy) { $page.url.searchParams.set('sortBy', sortBy); - window.history.replaceState(history.state, '', `?${$page.url.searchParams.toString()}`); + replaceState(`?${$page.url.searchParams.toString()}`, history.state); } } $: {