fix: replace history entries when searching (#62)

This commit is contained in:
Nihaal Sangha
2023-05-15 03:17:29 +01:00
committed by GitHub
parent 4c1b9c89f3
commit a57f3439f8
+2 -2
View File
@@ -63,9 +63,9 @@ export default function SearchBar({ searchList }: Props) {
searchParams.set("q", inputVal);
const newRelativePathQuery =
window.location.pathname + "?" + searchParams.toString();
history.pushState(null, "", newRelativePathQuery);
history.replaceState(null, "", newRelativePathQuery);
} else {
history.pushState(null, "", window.location.pathname);
history.replaceState(null, "", window.location.pathname);
}
}, [inputVal]);