preserve search page mode on manual search

This commit is contained in:
siikamiika 2020-02-10 01:31:47 +02:00
parent 460d306f60
commit 14b9f4a827

View File

@ -152,9 +152,13 @@ class DisplaySearch extends Display {
e.preventDefault();
const query = this.query.value;
this.queryParser.setText(query);
const queryString = query.length > 0 ? `?query=${encodeURIComponent(query)}` : '';
window.history.pushState(null, '', `${window.location.pathname}${queryString}`);
const url = new URL(window.location.href);
url.searchParams.set('query', query);
window.history.pushState(null, '', url.toString());
this.onSearchQueryUpdated(query, true);
}