From ad1b3150e51a09e740332016234c4018ad66f9c0 Mon Sep 17 00:00:00 2001
From: Webifi
Date: Wed, 7 Jun 2023 09:57:14 -0500
Subject: [PATCH] Block all prompt input while waiting for response
---
src/lib/Chat.svelte | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/lib/Chat.svelte b/src/lib/Chat.svelte
index 4c11253..13d4056 100644
--- a/src/lib/Chat.svelte
+++ b/src/lib/Chat.svelte
@@ -398,7 +398,7 @@
// Remove updating indicator
updating = 1 // hide indicator, but still signal we're updating
updatingMessage = ''
- console.log('ev.data', ev.data)
+ // console.log('ev.data', ev.data)
if (!chatResponse.hasFinished()) {
if (ev.data === '[DONE]') {
// ?? anything to do when "[DONE]"?
@@ -441,6 +441,7 @@
}
const addNewMessage = () => {
+ if (updating) return
let inputMessage: Message
const lastMessage = chat.messages[chat.messages.length - 1]
const uuid = uuidv4()
@@ -550,6 +551,7 @@
}
const recordToggle = () => {
+ if (updating) return
// Check if already recording - if so, stop - else start
if (recording) {
recognition?.stop()
@@ -619,7 +621,7 @@
/>
-
@@ -627,7 +629,7 @@
-
+
{#if updating}