diff --git a/static/js/chat.js b/static/js/chat.js index 2676616d..d0217e27 100644 --- a/static/js/chat.js +++ b/static/js/chat.js @@ -376,6 +376,7 @@ function addMessage(sender, message, id, rank = 0, can_edit = false) { // scroll to bottom of chat window chatWindow.scrollTop = chatWindow.scrollHeight; + messageElement.messageTextElement = messageTextElement messageElement.hiddenElement = hiddenElement messageElement.senderElement = senderElement messageElement.messageTextElement = messageTextElement diff --git a/static/js/main.js b/static/js/main.js index fbce6e0f..27a34519 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -66,13 +66,14 @@ function update_main(){ { // We parse it and infos = JSON.parse(text) + user_msg.setSender(infos.user) user_msg.setID(infos.id) bot_msg.setSender(infos.bot) bot_msg.setID(infos.response_id) - messageTextElement=elements; - hiddenElement=elements.hiddenElement; + messageTextElement=bot_msg.messageTextElement; + hiddenElement=bot_msg.hiddenElement; entry_counter ++; } else{