Browse Source

Don't show notification if peer is active

Temporary fix for bubble position
master
Eduard Kuzmenko 4 years ago
parent
commit
e88a7e7fa3
  1. 4
      src/components/chat/bubbles.ts
  2. 5
      src/lib/appManagers/appMessagesManager.ts
  3. 5
      src/lib/rootScope.ts

4
src/components/chat/bubbles.ts

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

5
src/lib/appManagers/appMessagesManager.ts

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

5
src/lib/rootScope.ts

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

Loading…
Cancel
Save