Fix header search when q URL param is not present

pull/9926/head
Sage Abdullah 2023-01-19 18:41:53 +00:00 zatwierdzone przez Matt Westcott
rodzic f35d4a966e
commit d4b69cbfc1
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -270,7 +270,7 @@ $(() => {
const search = function () {
const newQuery = $input.val();
const searchParams = new URLSearchParams(window.location.search);
const currentQuery = searchParams.get('q');
const currentQuery = searchParams.get('q') || '';
// only do the query if it has changed for trimmed queries
// for example - " " === "" and "firstword " ==== "firstword"
if (currentQuery.trim() !== newQuery.trim()) {