Include leading slash in path replacement for result config changes

This commit is contained in:
Ben Busby 2022-08-01 14:35:43 -06:00
parent 3f363b0175
commit aa198ed562
No known key found for this signature in database
GPG Key ID: B9B7231E01D924A1

View File

@ -6,7 +6,7 @@ document.addEventListener("DOMContentLoaded", () => {
countrySelect.onchange = () => {
let str = window.location.href;
n = str.lastIndexOf("search");
n = str.lastIndexOf("/search");
if (n > 0) {
str = str.substring(0, n) +
`search?q=${searchBar.value}&country=${countrySelect.value}`;