From 017d5cbaa2fa95275014840ea0ec6e3d21755b51 Mon Sep 17 00:00:00 2001 From: Satya Prakash Sasini Date: Fri, 8 Nov 2024 09:00:46 +0530 Subject: [PATCH 1/2] fix: message input field not clearing --- chatbot.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/chatbot.js b/chatbot.js index c8242c1..a3b9a2b 100644 --- a/chatbot.js +++ b/chatbot.js @@ -60,15 +60,14 @@ async function sendMessage() { let input = document.getElementById("chatbot-input").value; if (input) { displayUserMessage(input); - + document.getElementById("chatbot-input").value = ""; // Clearing the mesage iput field justn after user message is displayed. + // Wait for the chatbot response let output = await chatbot(input); // Ensure this line is awaited setTimeout(function () { displayBotMessage(output); }, 1000); - - document.getElementById("chatbot-input").value = ""; } } From 40674be993fa56a45e6316f22877b1746a167d81 Mon Sep 17 00:00:00 2001 From: Satya Prakash Sasini Date: Fri, 8 Nov 2024 09:18:05 +0530 Subject: [PATCH 2/2] misc: spelling rectificaation in comments --- chatbot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chatbot.js b/chatbot.js index a3b9a2b..b137545 100644 --- a/chatbot.js +++ b/chatbot.js @@ -60,7 +60,7 @@ async function sendMessage() { let input = document.getElementById("chatbot-input").value; if (input) { displayUserMessage(input); - document.getElementById("chatbot-input").value = ""; // Clearing the mesage iput field justn after user message is displayed. + document.getElementById("chatbot-input").value = ""; // Clearing the mesage input field just after user message is displayed. // Wait for the chatbot response let output = await chatbot(input); // Ensure this line is awaited