From 66b2556a6a7c911a69b231fddeefe0a939d8898d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 31 May 2024 03:14:05 +0200 Subject: fix: moving through search history shows no results --- frontend/static/search.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'frontend/static') 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; -- cgit 1.4.1