Skip to content

Commit d198937

Browse files
committed
fix: invalid path when modifying query params
1 parent 8521843 commit d198937

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

js/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function updateUrl(state, defaultState) {
2929
diff[key] = state[key].toString();
3030
}
3131
}
32-
window.history.replaceState(null, "", "/?" + new URLSearchParams(diff).toString());
32+
window.history.replaceState(null, "", window.location.pathname + "?" + new URLSearchParams(diff).toString());
3333
}
3434
window.onload = function () {
3535
var ytLink = getElementByIdOrDie("yt-link");

ts/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function updateUrl(state: State, defaultState: State) {
4343
diff[key] = state[key].toString();
4444
}
4545
}
46-
window.history.replaceState(null, "", "/?"+new URLSearchParams(diff).toString())
46+
window.history.replaceState(null, "", window.location.pathname + "?" + new URLSearchParams(diff).toString());
4747
}
4848

4949
window.onload = () => {

0 commit comments

Comments
 (0)