Skip to content

Commit ba9ca3a

Browse files
committed
Using Svelte's pushState()
1 parent 6a4a2ad commit ba9ca3a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/routes/+page.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import { preloadImage } from "$lib/util/dom";
1010
import LinkButton from "$lib/LinkButton.svelte";
1111
import { removeUrlParams } from "$lib/util/string";
12+
import { pushState } from "$app/navigation";
1213
1314
const api = new SongAPI();
1415
let offlineFlag = false;
@@ -77,7 +78,7 @@
7778
7879
function reset() {
7980
setStats(null);
80-
window.history.pushState({}, document.title, removeUrlParams(window.location.href));
81+
pushState(removeUrlParams(window.location.href), {});
8182
}
8283
8384
if(!import.meta.env.SSR) {

0 commit comments

Comments
 (0)