From c2a5e5a805cafd6e2cac503c2f983f1bc5ac9544 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Fri, 12 Apr 2024 00:03:14 +0100 Subject: [PATCH] Make API call on 3 or more characters --- src/components/GenerateRoadmap/AITermSuggestionInput.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/GenerateRoadmap/AITermSuggestionInput.tsx b/src/components/GenerateRoadmap/AITermSuggestionInput.tsx index f6670e264..1d183534a 100644 --- a/src/components/GenerateRoadmap/AITermSuggestionInput.tsx +++ b/src/components/GenerateRoadmap/AITermSuggestionInput.tsx @@ -69,6 +69,10 @@ export function AITermSuggestionInput(props: AITermSuggestionInputProps) { return []; } + if (trimmedValue.length < 3) { + return []; + } + if (termCache.has(trimmedValue)) { const cachedData = termCache.get(trimmedValue); return cachedData || [];