From 2c5b18c76be70f817457f2c7c5bff5107e77a13d Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 11 Sep 2022 15:06:28 +0100 Subject: [PATCH] fix: Avoid requesting recent searches until command bar is opened --- app/components/CommandBar.tsx | 2 +- app/components/SearchActions.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/components/CommandBar.tsx b/app/components/CommandBar.tsx index 9f76a1e21..d00a4d92d 100644 --- a/app/components/CommandBar.tsx +++ b/app/components/CommandBar.tsx @@ -38,10 +38,10 @@ function CommandBar() { return ( <> - + { - searches.fetchPage({}); + if (!searches.isLoaded) { + searches.fetchPage({}); + } }, [searches]); const { searchQuery } = useKBar((state) => ({