Don't show notification if peer is active

Temporary fix for bubble position
This commit is contained in:
Eduard Kuzmenko 2021-04-23 17:25:08 +04:00
parent aae32daf16
commit e88a7e7fa3
3 changed files with 12 additions and 2 deletions

View File

@ -168,7 +168,7 @@ export default class ChatBubbles {
const message = this.chat.getMessage(mid);
if(+bubble.dataset.timestamp >= (message.date + serverTimeManager.serverTimeOffset - 1)) {
this.bubbleGroups.addBubble(bubble, message, false);
//this.bubbleGroups.addBubble(bubble, message, false); // ! TEMP COMMENTED
return;
}
@ -1740,7 +1740,7 @@ export default class ChatBubbles {
public setBubblePosition(bubble: HTMLElement, message: any, reverse: boolean) {
const dateMessage = this.getDateContainerByMessage(message, reverse);
if(this.chat.type === 'scheduled' || this.chat.type === 'pinned' || true) {
if(this.chat.type === 'scheduled' || this.chat.type === 'pinned'/* || true */) { // ! TEMP COMMENTED
const offset = this.stickyIntersector ? 2 : 1;
let children = Array.from(dateMessage.container.children).slice(offset) as HTMLElement[];
let i = 0, foundMidOnSameTimestamp = 0;

View File

@ -3897,6 +3897,11 @@ export class AppMessagesManager {
for(const _peerId in this.notificationsToHandle) {
const peerId = +_peerId;
if(rootScope.peerId === peerId) {
continue;
}
const notifyPeerToHandle = this.notificationsToHandle[peerId];
Promise.all([

View File

@ -120,10 +120,15 @@ export class RootScope extends EventListenerBase<any> {
};
public connectionStatus: {[name: string]: ConnectionStatusChange} = {};
public settings: State['settings'];
public peerId = 0;
constructor() {
super();
this.on('peer_changed', (peerId) => {
this.peerId = peerId;
});
this.on('user_auth', (e) => {
this.myId = e;
});