Переглянути джерело

Merge pull request #1421 from zxdclyz/hide-hints

Fix: click the prompt button to hide hints when it's already shown
Yifei Zhang 1 рік тому
батько
коміт
cdfcf0f068
1 змінених файлів з 6 додано та 0 видалено
  1. 6 0
      app/components/chat.tsx

+ 6 - 0
app/components/chat.tsx

@@ -795,6 +795,12 @@ export function Chat() {
           scrollToBottom={scrollToBottom}
           hitBottom={hitBottom}
           showPromptHints={() => {
+            // Click again to close
+            if (promptHints.length > 0) {
+              setPromptHints([]);
+              return;
+            }
+
             inputRef.current?.focus();
             setUserInput("/");
             onSearch("");