Browse Source

fix: click the prompt button to hide hints when it's already shown

liyuze 1 year ago
parent
commit
ec19b86ade
1 changed files with 6 additions and 0 deletions
  1. 6 0
      app/components/chat.tsx

+ 6 - 0
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("");
           }}