Skip to content

Commit

Permalink
use sveltekit replaceState()
Browse files Browse the repository at this point in the history
  • Loading branch information
merklejerk committed Jun 19, 2024
1 parent 2f0fb3f commit c35e87f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/routes/(app)/players/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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);
}
}
$: {
Expand Down

0 comments on commit c35e87f

Please sign in to comment.