From 177f2e92f84a73fded08a6f01025ec647cdd2186 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 17 Oct 2024 21:34:30 -0700 Subject: [PATCH] amend - fix disabled --- extensions/void/src/sidebar/SidebarChat.tsx | 13 +++++++++---- extensions/void/src/sidebar/styles.css | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/extensions/void/src/sidebar/SidebarChat.tsx b/extensions/void/src/sidebar/SidebarChat.tsx index 87c361d4..01014564 100644 --- a/extensions/void/src/sidebar/SidebarChat.tsx +++ b/extensions/void/src/sidebar/SidebarChat.tsx @@ -136,10 +136,13 @@ export const SidebarChat = () => { }) + const isDisabled = !instructions + const formRef = useRef(null) const onSubmit = async (e: FormEvent) => { e.preventDefault() + if (isDisabled) return if (isLoading) return setIsLoading(true) @@ -238,6 +241,7 @@ export const SidebarChat = () => { )} /> )} } +
{ onSubmit={(e) => { console.log('submit!') - e.preventDefault(); onSubmit(e) }}> {/* input */} @@ -257,16 +260,18 @@ export const SidebarChat = () => { rows={1} onInput={e => { e.currentTarget.style.height = 'auto'; e.currentTarget.style.height = e.currentTarget.scrollHeight + 'px' }} // Adjust height dynamically /> - {/* submit button */} {isLoading ? + // stop button - :