Обновить assets/js/chat.js

This commit is contained in:
Каримов Адель 2024-08-27 19:32:31 +00:00
parent 4c9630a299
commit 3da3777285

View File

@ -68,7 +68,7 @@ async function sendMessage() {
const usernameElement = document.createElement('div');
usernameElement.classList.add('username');
usernameElement.textContent = await getUserName();
usernameElement.textContent = await getUserName(); // Отображение имени пользователя
const textElement = document.createElement('div');
textElement.classList.add('text');
@ -88,6 +88,7 @@ async function sendMessage() {
}
}
function openMembersList() {
renderMembersList();
document.getElementById("members-list").style.display = "block";
@ -157,6 +158,18 @@ async function editMessage(new_message) {
currentHistoryId = response.update[0].HistoryId;
}
}
function editChat() {
const newName = prompt("Введите новое имя комнаты:");
if (newName) {
document.getElementById('room-name').textContent = newName;
}
}
function exitChat() {
window.location.href = 'list-rooms.nytl.html';
}
document.addEventListener("DOMContentLoaded", async function() {
currentChatID = await getChatID();
});