Skip to content

Commit

Permalink
Search defaults to current drive as scope #254
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Oct 27, 2022
1 parent 065dc0c commit f271a14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This changelog covers all three packages, as they are (for now) updated as a who

- Add folders with list & grid views, allow drag & drop uploads #228
- Show icons in sidebar
- Add scoped search, funded by NGI NLnet Discovery #245
- Add scoped search, funded by NGI NLnet Discovery #245 #254
- Make web app installable #30
- Add cookie based authentication #241
- Get rid of `useWindowSize` #256
Expand Down
4 changes: 3 additions & 1 deletion data-browser/src/routes/SearchRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ import { ErrorLook } from '../components/ErrorLook';
import styled from 'styled-components';
import { FaSearch } from 'react-icons/fa';
import { useQueryScopeHandler } from '../hooks/useQueryScope';
import { useSettings } from '../helpers/AppSettings';

/** Full text search route */
export function Search(): JSX.Element {
const [query] = useSearchQuery();
const { drive } = useSettings();
const { scope } = useQueryScopeHandler();

const [selectedIndex, setSelected] = useState(0);
const { results, loading, error } = useServerSearch(query, {
debounce: 0,
scope,
scope: scope || drive,
});
const navigate = useNavigate();
const htmlElRef = useRef<HTMLDivElement | null>(null);
Expand Down

0 comments on commit f271a14

Please sign in to comment.