fix: moving through search history shows no results
Alan Pearce alan@alanpearce.eu
Fri, 31 May 2024 03:14:05 +0200
1 files changed, 2 insertions(+), 2 deletions(-)
jump to
M frontend/static/search.js → 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 @@ 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;