all repos — searchix @ 66b2556a6a7c911a69b231fddeefe0a939d8898d

Search engine for NixOS, nix-darwin, home-manager and NUR users

fix: moving through search history shows no results
Alan Pearce alan@alanpearce.eu
Fri, 31 May 2024 03:14:05 +0200
commit

66b2556a6a7c911a69b231fddeefe0a939d8898d

parent

fc7542e01f1d6f9e1c11bacf0060c0165ba54986

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M frontend/static/search.jsfrontend/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 @@ 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;