From 603f8381151ff40d009629a916d59307aaa1a780 Mon Sep 17 00:00:00 2001 From: sabaimran Date: Sat, 11 Nov 2023 17:14:37 -0800 Subject: [PATCH] Block input text field when waiting for chat response --- src/khoj/interface/web/chat.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/khoj/interface/web/chat.html b/src/khoj/interface/web/chat.html index e1c9979d..bd4870e4 100644 --- a/src/khoj/interface/web/chat.html +++ b/src/khoj/interface/web/chat.html @@ -205,8 +205,11 @@ To get started, just start typing below. You can also type / to see a list of co // Evaluate the contents of new_response_text.innerHTML after all the data has been streamed const currentHTML = newResponseText.innerHTML; newResponseText.innerHTML = formatHTMLMessage(currentHTML); - newResponseText.appendChild(references); + if (references != null) { + newResponseText.appendChild(references); + } document.getElementById("chat-body").scrollTop = document.getElementById("chat-body").scrollHeight; + document.getElementById("chat-input").removeAttribute("disabled"); return; } @@ -265,7 +268,6 @@ To get started, just start typing below. You can also type / to see a list of co }); } readStream(); - document.getElementById("chat-input").removeAttribute("disabled"); }); }