From ec19b86ade04857bf339b26c853f27b0ba2688a8 Mon Sep 17 00:00:00 2001 From: liyuze Date: Thu, 11 May 2023 18:29:25 +0800 Subject: [PATCH] fix: click the prompt button to hide hints when it's already shown --- app/components/chat.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 54def01c..9363966c 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -789,6 +789,12 @@ export function Chat() { scrollToBottom={scrollToBottom} hitBottom={hitBottom} showPromptHints={() => { + // Click again to close + if (promptHints.length > 0) { + setPromptHints([]); + return; + } + inputRef.current?.focus(); onSearch(""); }}