fix: Avoid requesting recent searches until command bar is opened

This commit is contained in:
Tom Moor
2022-09-11 15:06:28 +01:00
parent 6877312b7a
commit 2c5b18c76b
2 changed files with 4 additions and 2 deletions

View File

@@ -38,10 +38,10 @@ function CommandBar() {
return (
<>
<SearchActions />
<KBarPortal>
<Positioner>
<Animator>
<SearchActions />
<SearchInput
placeholder={`${
rootAction?.placeholder ||

View File

@@ -10,7 +10,9 @@ export default function SearchActions() {
const { searches } = useStores();
React.useEffect(() => {
if (!searches.isLoaded) {
searches.fetchPage({});
}
}, [searches]);
const { searchQuery } = useKBar((state) => ({