mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-19 14:36:22 -05:00
Fixing bug where searching zims did not show results.
This commit is contained in:
parent
63eff3f006
commit
c67e3ff490
1 changed files with 6 additions and 4 deletions
|
|
@ -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 = <span>Files <Label>{normalizeEstimate(suggestionsSums?.fileGroups)}</Label></span>;
|
||||
const zimsTabName = <span>Zims <Label>{normalizeEstimate(suggestionsSums?.zims)}</Label></span>;
|
||||
const othersTabName = <span>Other <Label>{normalizeEstimate(suggestionsSums?.otherSum)}</Label></span>;
|
||||
|
||||
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 <React.Fragment>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue