Fix second read check
This commit is contained in:
parent
bab69c170a
commit
e09d6a8d40
@ -406,9 +406,10 @@ export default class ChatBubbles {
|
|||||||
|
|
||||||
//getHeavyAnimationPromise().then(() => {
|
//getHeavyAnimationPromise().then(() => {
|
||||||
fastRaf(() => {
|
fastRaf(() => {
|
||||||
if(bubble.classList.contains('is-outgoing')) {
|
const mid = +bubble.dataset.mid;
|
||||||
|
if(bubbles[mid] === bubble && bubble.classList.contains('is-outgoing')) {
|
||||||
bubble.classList.remove('is-sending', 'is-outgoing');
|
bubble.classList.remove('is-sending', 'is-outgoing');
|
||||||
bubble.classList.add(this.peerId === rootScope.myId && this.chat.type !== 'scheduled' ? 'is-read' : 'is-sent');
|
bubble.classList.add((this.peerId === rootScope.myId && this.chat.type !== 'scheduled') || !this.unreadOut.has(mid) ? 'is-read' : 'is-sent');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//});
|
//});
|
||||||
@ -754,7 +755,10 @@ export default class ChatBubbles {
|
|||||||
this.listenerSetter.add(rootScope)('dialog_unread', ({peerId}) => {
|
this.listenerSetter.add(rootScope)('dialog_unread', ({peerId}) => {
|
||||||
if(peerId === this.peerId) {
|
if(peerId === this.peerId) {
|
||||||
this.chat.input.setUnreadCount();
|
this.chat.input.setUnreadCount();
|
||||||
this.updateUnreadByDialog();
|
|
||||||
|
getHeavyAnimationPromise().then(() => {
|
||||||
|
this.updateUnreadByDialog();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1900,6 +1904,8 @@ export default class ChatBubbles {
|
|||||||
if(msgId > 0 && msgId <= maxId) {
|
if(msgId > 0 && msgId <= maxId) {
|
||||||
const bubble = this.bubbles[msgId];
|
const bubble = this.bubbles[msgId];
|
||||||
if(bubble) {
|
if(bubble) {
|
||||||
|
this.unreadOut.delete(msgId);
|
||||||
|
|
||||||
if(bubble.classList.contains('is-outgoing')) {
|
if(bubble.classList.contains('is-outgoing')) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1907,8 +1913,6 @@ export default class ChatBubbles {
|
|||||||
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.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');
|
bubble.classList.add('is-read');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.unreadOut.delete(msgId);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user