This commit is contained in:
Saifeddine ALOUI 2023-04-17 23:39:15 +02:00
parent 580e31f4e9
commit 4a4a5a82ec

View File

@ -72,8 +72,8 @@ function update_main(){
bot_msg.setSender(infos.bot) bot_msg.setSender(infos.bot)
bot_msg.setID(infos.response_id) bot_msg.setID(infos.response_id)
messageTextElement=bot_msg.messageTextElement; messageTextElement = bot_msg.messageTextElement;
hiddenElement=bot_msg.hiddenElement; hiddenElement = bot_msg.hiddenElement;
entry_counter ++; entry_counter ++;
} }
else{ else{
@ -81,17 +81,17 @@ function update_main(){
prefix = "FINAL:"; prefix = "FINAL:";
if(text.startsWith(prefix)){ if(text.startsWith(prefix)){
text = text.substring(prefix.length); text = text.substring(prefix.length);
hiddenElement.innerHTML = text hiddenElement.innerHTML = text
messageTextElement.innerHTML = text messageTextElement.innerHTML = text
} }
else{ else{
// For the other enrtries, these are just the text of the chatbot // For the other enrtries, these are just the text of the chatbot
for (const char of text) { for (const char of text) {
txt = hiddenElement.innerHTML; txt = hiddenElement.innerHTML;
if (char != '\f') { if (char != '\f') {
txt += char txt += char
hiddenElement.innerHTML = txt hiddenElement.innerHTML = txt
messageTextElement.innerHTML = txt messageTextElement.innerHTML = txt
} }
// scroll to bottom of chat window // scroll to bottom of chat window