aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/search.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/search.js')
-rw-r--r--ext/bg/js/search.js9
1 files changed, 2 insertions, 7 deletions
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js
index 11d1d871..bfd88552 100644
--- a/ext/bg/js/search.js
+++ b/ext/bg/js/search.js
@@ -74,7 +74,6 @@ class DisplaySearch extends Display {
query = window.wanakana.toKana(query);
}
this.query.value = query;
- window.history.replaceState({query}, '');
this.onSearchQueryUpdated(query, false);
}
}
@@ -130,16 +129,12 @@ class DisplaySearch extends Display {
const query = this.query.value;
const queryString = query.length > 0 ? `?query=${encodeURIComponent(query)}` : '';
- window.history.pushState({query}, '', `${window.location.pathname}${queryString}`);
+ window.history.pushState(null, '', `${window.location.pathname}${queryString}`);
this.onSearchQueryUpdated(query, true);
}
onPopState(e) {
- let query = '';
- if (e.state && e.state.query) {
- query = e.state.query
- }
-
+ const query = DisplaySearch.getSearchQueryFromLocation(window.location.href) || '';
if (this.query !== null) {
this.query.value = query;
}