INNER CODE UNIT · JavaScript
newMessage
autokitteh/autokitteh · internal/backend/webtools/web/webmessages/app.js:64
const newMessage = (msg) => {
/* Add message to DOM */
chatMessages.innerHTML += createChatMessageElement(msg)
/* Clear input field */
chatInputForm.reset()
/* Scroll to bottom of chat messages */
chatMessages.scrollTop = chatMessages.scrollHeight
}
const sendMessage = async (e) => {
e.preventDefault()
if (window.location.protocol === 'file:') {
console.log('Cannot send messages in file protocol')
return
}