🛠️ fix: Improve SSE Handling and Fix Typo in sendEmail Template (#1245)

* fix: typo for passwordReset.handlebars

* fix(useSSE): prevent unnecessary JSON.parse abort error, handle immediate abort-submit gracefully by reverting to previous state before immediate abort-submit, add showStopButton state to explicitly render disabled sendButton when message generation is cancelled, filter undefined messages and replace undefined convo for cancelHandler
This commit is contained in:
Danny Avila 2023-11-30 10:23:57 -05:00 committed by GitHub
parent e13b146d6d
commit 166a4fa44f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 33 additions and 17 deletions

View file

@ -19,6 +19,8 @@ export default function ChatForm({ index = 0 }) {
handleStopGenerating,
filesLoading,
setFilesLoading,
showStopButton,
setShowStopButton,
} = useChatContext();
const submitMessage = () => {
@ -46,10 +48,10 @@ export default function ChatForm({ index = 0 }) {
endpoint={conversation?.endpoint}
/>
<AttachFile endpoint={conversation?.endpoint ?? ''} />
{isSubmitting ? (
<StopButton stop={handleStopGenerating} />
{isSubmitting && showStopButton ? (
<StopButton stop={handleStopGenerating} setShowStopButton={setShowStopButton} />
) : (
<SendButton text={text} disabled={filesLoading} />
<SendButton text={text} disabled={filesLoading || isSubmitting} />
)}
</div>
</div>