From 963b71d02021789c0454b11914fedd2a1d1b30bd Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Fri, 18 Jun 2021 20:11:44 +0300 Subject: [PATCH] Fix reading status when sending messages to bot --- src/components/chat/bubbles.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/chat/bubbles.ts b/src/components/chat/bubbles.ts index f51d4497..ea0b2982 100644 --- a/src/components/chat/bubbles.ts +++ b/src/components/chat/bubbles.ts @@ -310,8 +310,10 @@ export default class ChatBubbles { //getHeavyAnimationPromise().then(() => { fastRaf(() => { - bubble.classList.remove('is-sending'); - bubble.classList.add(this.peerId === rootScope.myId && this.chat.type !== 'scheduled' ? 'is-read' : 'is-sent'); + if(bubble.classList.contains('is-sending')) { + bubble.classList.remove('is-sending'); + bubble.classList.add(this.peerId === rootScope.myId && this.chat.type !== 'scheduled' ? 'is-read' : 'is-sent'); + } }); //}); @@ -1222,7 +1224,7 @@ export default class ChatBubbles { if(msgId > 0 && msgId <= maxId) { const bubble = this.bubbles[msgId]; if(bubble) { - bubble.classList.remove('is-sent'); + 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.add('is-read'); }