From 6c3074061b2d128c239128d082b2021d83126d86 Mon Sep 17 00:00:00 2001 From: sabaimran Date: Tue, 1 Aug 2023 00:21:39 -0700 Subject: [PATCH] Disable the input bar when chat response is in flight --- src/khoj/interface/web/chat.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/khoj/interface/web/chat.html b/src/khoj/interface/web/chat.html index 9b3efa5a..024aa16c 100644 --- a/src/khoj/interface/web/chat.html +++ b/src/khoj/interface/web/chat.html @@ -61,6 +61,7 @@ // Add message by user to chat body renderMessage(query, "you"); document.getElementById("chat-input").value = ""; + document.getElementById("chat-input").setAttribute("disabled", "disabled"); // Generate backend API URL to execute query let url = `/api/chat?q=${encodeURIComponent(query)}&n=${results_count}&client=web&stream=true`; @@ -122,6 +123,7 @@ }); } readStream(); + document.getElementById("chat-input").removeAttribute("disabled"); }); }