diff --git a/src/components/chat/contextMenu.ts b/src/components/chat/contextMenu.ts index 58eecf1c..0d324f08 100644 --- a/src/components/chat/contextMenu.ts +++ b/src/components/chat/contextMenu.ts @@ -295,7 +295,7 @@ export default class ChatContextMenu { if(appImManager.chatSelection.isSelecting) { appImManager.chatSelection.selectionDeleteBtn.click(); } else { - new PopupDeleteMessages([this.msgID]); + new PopupDeleteMessages(this.isTargetAnAlbumItem ? [this.msgID] : appMessagesManager.getMidsByMid(this.msgID)); } }; } \ No newline at end of file diff --git a/src/lib/appManagers/appImManager.ts b/src/lib/appManagers/appImManager.ts index be2430a0..54732c89 100644 --- a/src/lib/appManagers/appImManager.ts +++ b/src/lib/appManagers/appImManager.ts @@ -750,7 +750,7 @@ export class AppImManager { return; } - if(e.target != this.chatInputC.messageInput && target.tagName != 'INPUT') { + if(e.target != this.chatInputC.messageInput && target.tagName != 'INPUT' && !target.hasAttribute('contenteditable')) { this.chatInputC.messageInput.focus(); placeCaretAtEnd(this.chatInputC.messageInput); } @@ -1724,7 +1724,16 @@ export class AppImManager { bubble.classList.add('is-first-unread'); } + // * Нужно очистить прошлую информацию, полезно если удалить последний элемент из альбома в ПОСЛЕДНЕМ БАББЛЕ ГРУППЫ (видно по аватару) const originalMid = +bubble.dataset.mid; + if(+message.mid != originalMid) { + this.bubbleGroups.removeBubble(bubble, originalMid); + + if(!updatePosition) { + this.bubbleGroups.addBubble(bubble, message, reverse); + } + } + delete this.bubbles[originalMid]; //bubble.innerHTML = ''; }