Skip to content

Commit f271a14

Browse files
committed
Search defaults to current drive as scope #254
1 parent 065dc0c commit f271a14

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This changelog covers all three packages, as they are (for now) updated as a who
66

77
- Add folders with list & grid views, allow drag & drop uploads #228
88
- Show icons in sidebar
9-
- Add scoped search, funded by NGI NLnet Discovery #245
9+
- Add scoped search, funded by NGI NLnet Discovery #245 #254
1010
- Make web app installable #30
1111
- Add cookie based authentication #241
1212
- Get rid of `useWindowSize` #256

data-browser/src/routes/SearchRoute.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ import { ErrorLook } from '../components/ErrorLook';
99
import styled from 'styled-components';
1010
import { FaSearch } from 'react-icons/fa';
1111
import { useQueryScopeHandler } from '../hooks/useQueryScope';
12+
import { useSettings } from '../helpers/AppSettings';
1213

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

1820
const [selectedIndex, setSelected] = useState(0);
1921
const { results, loading, error } = useServerSearch(query, {
2022
debounce: 0,
21-
scope,
23+
scope: scope || drive,
2224
});
2325
const navigate = useNavigate();
2426
const htmlElRef = useRef<HTMLDivElement | null>(null);

0 commit comments

Comments
 (0)