You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
926 B
JavaScript

(function() {
const endChat = document.getElementById('endChat');
const endChatConfirmationContainer = document.getElementById("endChatConfirmationContainer");
const closeConfirmationMessage = document.getElementById('closeConfirmationMessage');
const endChatConfirmed = document.getElementById('endChatComfirmed');
endChat.addEventListener("click", function() {
if (endChatConfirmationContainer) {
endChatConfirmationContainer.classList.remove("hidden");
}
});
closeConfirmationMessage.addEventListener("click", function() {
if (closeConfirmationMessage) {
endChatConfirmationContainer.classList.add("hidden");
}
});
endChatConfirmed.addEventListener("click", function() {
const eventMessage = {
event_type: 'end_chat',
};
osichatSocket.send(JSON.stringify(eventMessage));
});
})();