about summary refs log tree commit diff stats
path: root/frontend/static
diff options
context:
space:
mode:
authorAlan Pearce2024-05-31 03:14:05 +0200
committerAlan Pearce2024-05-31 03:14:05 +0200
commit66b2556a6a7c911a69b231fddeefe0a939d8898d (patch)
treeacbd386c3336671e54f1866bb6fbe58c4d00fdf1 /frontend/static
parentfc7542e01f1d6f9e1c11bacf0060c0165ba54986 (diff)
downloadsearchix-66b2556a6a7c911a69b231fddeefe0a939d8898d.tar.lz
searchix-66b2556a6a7c911a69b231fddeefe0a939d8898d.tar.zst
searchix-66b2556a6a7c911a69b231fddeefe0a939d8898d.zip
fix: moving through search history shows no results
Diffstat (limited to 'frontend/static')
-rw-r--r--frontend/static/search.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/frontend/static/search.js b/frontend/static/search.js
index b16cf30..8d30d89 100644
--- a/frontend/static/search.js
+++ b/frontend/static/search.js
@@ -12,7 +12,7 @@ let urlLocation = new URL(location);
 let state = history.state || {
   url: urlLocation.toString(),
   input: urlLocation.searchParams.get("query"),
-  fragment: range.cloneContents().innerHTML || "",
+  fragment: range.cloneContents().innerHTML || null,
   opened: [],
 };
 
@@ -147,7 +147,7 @@ if (state.opened.length > 0) {
 addEventListener("popstate", function (ev) {
   if (ev.state != null) {
     url = new URL(ev.state.url);
-    if (!url.pathname.endsWith("/search") && ev.state.fragment !== null) {
+    if (ev.state.fragment !== null) {
       queryInput.value = ev.state.input;
       renderFragmentHTML(ev.state.fragment);
       return;