diff --git a/src/components/CommandKClient.tsx b/src/components/CommandKClient.tsx index 56dc52b9..ae7dad4a 100644 --- a/src/components/CommandKClient.tsx +++ b/src/components/CommandKClient.tsx @@ -96,7 +96,7 @@ export default function CommandKClient({ }, [setIsOpen]); useEffect(() => { - if (queryDebounced.length >= MINIMUM_QUERY_LENGTH) { + if (queryDebounced.length >= MINIMUM_QUERY_LENGTH && !isPending) { setIsLoading(true); getPhotoItemsAction(queryDebounced).then(querySections => { if (isOpenRef.current) { @@ -108,7 +108,7 @@ export default function CommandKClient({ setIsLoading(false); }); } - }, [queryDebounced]); + }, [queryDebounced, isPending]); useEffect(() => { if (queryLive === '') { @@ -181,7 +181,7 @@ export default function CommandKClient({ placeholder="Search photos, views, settings ..." disabled={isPending} /> - {isLoading && + {isLoading && !isPending &&