Skip to content

Commit

Permalink
fix: sync search keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
finnar-bin committed Jan 3, 2024
1 parent f30fa5b commit 2542f1b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/shell/components/GlobalSearch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,14 @@ export const GlobalSearch = () => {
setMediaFolderKeyword(apiQueryTerm);
}, [apiQueryTerm]);

useEffect(() => {
const paramsSearchKeyword = params?.get("q");

if (paramsSearchKeyword) {
setSearchKeyword(paramsSearchKeyword);
}
}, [params]);

//@ts-ignore TODO fix typing for useMetaKey
const shortcutHelpText = useMetaKey("k", () => {
textfieldRef.current?.querySelector("input").focus();
Expand Down

0 comments on commit 2542f1b

Please sign in to comment.