Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
fix: hide search icon while disable search
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed May 7, 2022
1 parent 48165c8 commit 3f3722e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pages/list/layout/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ const Search = (props: SearchProps) => {
inputRef.current?.focus();
}
const switchSearch = (e: KeyboardEvent) => {
if (["f", "F"].includes(e.key) && e.ctrlKey) {
if (["k", "K"].includes(e.key) && e.ctrlKey) {
props.setIsSearch(!props.isSearch);
e.preventDefault();
}
};
document.addEventListener("keydown", switchSearch);
if(getSetting("enable search") === "true"){document.addEventListener("keydown", switchSearch);}
const cancelSearch = (e: MouseEvent) => {
props.setIsSearch(false);
};
Expand All @@ -40,7 +40,7 @@ const Search = (props: SearchProps) => {
document.removeEventListener("click", cancelSearch);
};
}, [props.isSearch]);
// if (!getSetting("enable search")) return null;
if (getSetting("enable search") !== "true") return null;
return (
<HStack
spacing={2}
Expand Down

0 comments on commit 3f3722e

Please sign in to comment.