From c67e3ff490c5b5393cc9e02df0178b90e6f8dda8 Mon Sep 17 00:00:00 2001 From: Roland Date: Sun, 22 Mar 2026 13:30:33 -0600 Subject: [PATCH] Fixing bug where searching zims did not show results. --- app/src/components/Search.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/components/Search.js b/app/src/components/Search.js index 27d042f5..99157686 100644 --- a/app/src/components/Search.js +++ b/app/src/components/Search.js @@ -1,5 +1,5 @@ import React, {useState} from "react"; -import {Link, Route, Routes, useNavigate} from "react-router"; +import {Link, Route, Routes, useLocation, useNavigate} from "react-router"; import {FilesSearchView} from "./Files"; import {useLatestRequest, usePages, useSearchChannels, useSearchDate, useSearchFilter} from "../hooks/customHooks"; import {ShortcutHint} from "./ShortcutHint"; @@ -411,15 +411,17 @@ export function useSearchSuggestions(defaultSearchStr, defaultTagNames, anyTag) export function SearchView({suggestions, suggestionsSums, loading}) { + const location = useLocation(); + const search = location.search; const filesTabName = Files ; const zimsTabName = Zims ; const othersTabName = Other ; const links = [ - {text: filesTabName, to: '/search', key: 'filesSearch_', end: true}, - {text: zimsTabName, to: '/search/zim', key: 'zimsSearch'}, - {text: othersTabName, to: '/search/other', key: 'othersSearch'}, + {text: filesTabName, to: `/search${search}`, key: 'filesSearch_', end: true}, + {text: zimsTabName, to: `/search/zim${search}`, key: 'zimsSearch'}, + {text: othersTabName, to: `/search/other${search}`, key: 'othersSearch'}, ]; return