Skip to content

Commit 6737b04

Browse files
committed
Using removeUrlParams()
1 parent 30b74ce commit 6737b04

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/routes/+page.svelte

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import { wait } from "$lib/util";
1010
import { preloadImage } from "$lib/util/dom";
1111
import LinkButton from "$lib/LinkButton.svelte";
12+
import { removeUrlParams } from "$lib/util/string";
1213
1314
const api = new SongAPI();
1415
let offlineFlag = false;
@@ -77,10 +78,7 @@
7778
7879
function reset() {
7980
setStats(null);
80-
81-
const urlSplit = window.location.href.split("?");
82-
const urlWithoutParams = urlSplit[0];
83-
window.history.pushState({}, document.title, urlWithoutParams);
81+
window.history.pushState({}, document.title, removeUrlParams(window.location.href));
8482
}
8583
8684
if(!import.meta.env.SSR) {

0 commit comments

Comments
 (0)