diff --git a/src/pages/chat/chat.ts b/src/pages/chat/chat.ts index 1a714e5..21d14a8 100755 --- a/src/pages/chat/chat.ts +++ b/src/pages/chat/chat.ts @@ -457,7 +457,7 @@ class ChatElement extends HTMLElement { messageContent.className = `message ${isCurrentUser ? 'user' : ''}`; const senderEmoji = await addressToEmoji(message.metadata.sender); - + if (message.type === 'file') { let fileContent = ''; if (message.content.type.startsWith('image/')) { @@ -721,6 +721,25 @@ class ChatElement extends HTMLElement { li.appendChild(roleList); groupList.appendChild(li); + + container.addEventListener('click', (event) => { + event.stopPropagation(); + container.classList.toggle('expanded'); + const roleList = container.parentElement?.querySelector('.role-list'); + const dm = container.parentElement?.querySelector('.dm'); + + if (roleList) { + // Si le container est expanded, on montre la liste des rôles + if (container.classList.contains('expanded')) { + (roleList as HTMLElement).style.display = 'block'; + if (dm) (dm as HTMLElement).style.display = 'block'; + } else { + // Sinon on cache la liste des rôles + (roleList as HTMLElement).style.display = 'none'; + if (dm) (dm as HTMLElement).style.display = 'none'; + } + } + }); } @@ -925,7 +944,7 @@ class ChatElement extends HTMLElement { if (this.processId) { console.log('🔍 Loading chat with process ID:', this.processId); this.loadGroupListFromAProcess(this.processId); - } else { + } else if(this.processId == null){ console.error('❌ No process ID found in element attributes'); this.loadAllGroupList(); }