Add functionality to attachment button, fix escape ev listener preventing all events default behavior.

This commit is contained in:
天クマ 2026-07-14 16:28:33 -03:00
commit ccb1233181
6 changed files with 70 additions and 8 deletions

4
ui.js
View file

@ -31,6 +31,8 @@ export const elements = {
chatBottomBar: document.getElementById('chat-bottom-bar'),
chatBottomBarBtn: document.getElementById('chat-bottom-bar-btn'),
chatInputPanel: document.getElementById('chat-input-panel'),
attachmentInput: document.getElementById('attachment-input'),
attachmentBtn: document.getElementById('attachment-btn'),
};
export const ui = {
@ -90,7 +92,6 @@ export const ui = {
}
for (const chat of chats) {
console.log(chat);
const li = document.createElement('li');
li.className = `chat-item ${activeChat && activeChat.id === chat.id ? 'active' : ''}`;
li.dataset.id = chat.id;
@ -142,7 +143,6 @@ export const ui = {
* Append a single message (used for optimistic updates immediately upon sending)
*/
appendSingleMessage(msg, activeChatName, userID, chatId) {
console.log(msg);
const isOutgoing = msg.fromMe || msg.sender === 'me';
const groupDiv = document.createElement('div');