From 3ab7365a3b5455d668f9215b7a162aeb8b1227c0 Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Wed, 23 Feb 2022 15:10:35 +0200 Subject: [PATCH] Do not display fast reaction on changelog --- src/components/chat/bubbles.ts | 14 +++++++++----- src/components/chat/selection.ts | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/chat/bubbles.ts b/src/components/chat/bubbles.ts index 061e627f..e28f9378 100644 --- a/src/components/chat/bubbles.ts +++ b/src/components/chat/bubbles.ts @@ -392,8 +392,8 @@ export default class ChatBubbles { //getHeavyAnimationPromise().then(() => { fastRaf(() => { - if(bubble.classList.contains('is-sending')) { - bubble.classList.remove('is-sending'); + if(bubble.classList.contains('is-outgoing')) { + bubble.classList.remove('is-sending', 'is-outgoing'); bubble.classList.add(this.peerId === rootScope.myId && this.chat.type !== 'scheduled' ? 'is-read' : 'is-sent'); } }); @@ -1750,11 +1750,11 @@ export default class ChatBubbles { if(msgId > 0 && msgId <= maxId) { const bubble = this.bubbles[msgId]; if(bubble) { - if(bubble.classList.contains('is-sending')) { + if(bubble.classList.contains('is-outgoing')) { continue; } - bubble.classList.remove('is-sent', 'is-sending'); // is-sending can be when there are bulk of updates (e.g. sending command to Stickers bot) + bubble.classList.remove('is-sent', 'is-sending', 'is-outgoing'); // is-sending can be when there are bulk of updates (e.g. sending command to Stickers bot) bubble.classList.add('is-read'); } @@ -2714,7 +2714,7 @@ export default class ChatBubbles { const peerId = this.peerId; // * can't use 'message.pFlags.out' here because this check will be used to define side of message (left-right) - const our = message.fromId === rootScope.myId || (message.pFlags.out && this.appPeersManager.isMegagroup(this.peerId)); + const our = message.fromId === rootScope.myId || (message.pFlags.out && this.appPeersManager.isMegagroup(peerId)); const messageDiv = document.createElement('div'); messageDiv.classList.add('message'); @@ -3056,6 +3056,10 @@ export default class ChatBubbles { bubble.classList.add(status); } + if(isOutgoing) { + bubble.classList.add('is-outgoing'); + } + const messageWithReplies = isMessage && this.appMessagesManager.getMessageWithReplies(message); const withReplies = !!messageWithReplies && message.mid > 0; diff --git a/src/components/chat/selection.ts b/src/components/chat/selection.ts index 6649d756..b1631de7 100644 --- a/src/components/chat/selection.ts +++ b/src/components/chat/selection.ts @@ -828,7 +828,7 @@ export default class ChatSelection extends AppSelection { public canSelectBubble(bubble: HTMLElement) { return !bubble.classList.contains('service') && - !bubble.classList.contains('is-sending') && + !bubble.classList.contains('is-outgoing') && !bubble.classList.contains('bubble-first') && !bubble.classList.contains('avoid-selection'); }