Fix mentions count again
This commit is contained in:
parent
bbed308d75
commit
d8c401b9b6
@ -4089,6 +4089,13 @@ export class AppMessagesManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fixUnreadMentionsCountIfNeeded(peerId: PeerId, slicedArray: SlicedArray) {
|
||||||
|
const dialog = this.getDialogOnly(peerId);
|
||||||
|
if(!slicedArray.length && dialog?.unread_mentions_count) {
|
||||||
|
this.reloadConversation(peerId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public goToNextMention(peerId: PeerId) {
|
public goToNextMention(peerId: PeerId) {
|
||||||
/* this.getUnreadMentions(peerId, 1, 2, 0).then(messages => {
|
/* this.getUnreadMentions(peerId, 1, 2, 0).then(messages => {
|
||||||
console.log(messages);
|
console.log(messages);
|
||||||
@ -4103,6 +4110,7 @@ export class AppMessagesManager {
|
|||||||
const length = slicedArray.length;
|
const length = slicedArray.length;
|
||||||
const isTopEnd = slicedArray.first.isEnd(SliceEnd.Top);
|
const isTopEnd = slicedArray.first.isEnd(SliceEnd.Top);
|
||||||
if(!length && isTopEnd) {
|
if(!length && isTopEnd) {
|
||||||
|
this.fixUnreadMentionsCountIfNeeded(peerId, slicedArray);
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4117,6 +4125,8 @@ export class AppMessagesManager {
|
|||||||
if(mid) {
|
if(mid) {
|
||||||
slicedArray.delete(mid);
|
slicedArray.delete(mid);
|
||||||
rootScope.dispatchEvent('history_focus', {peerId, mid});
|
rootScope.dispatchEvent('history_focus', {peerId, mid});
|
||||||
|
} else {
|
||||||
|
this.fixUnreadMentionsCountIfNeeded(peerId, slicedArray);
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
delete this.goToNextMentionPromises[peerId];
|
delete this.goToNextMentionPromises[peerId];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user