Merge pull request #1421 from zxdclyz/hide-hints

Fix: click the prompt button to hide hints when it's already shown
This commit is contained in:
Yifei Zhang 2023-05-11 18:53:59 +08:00 committed by GitHub
commit cdfcf0f068
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -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("");