bug fixed
This commit is contained in:
parent
5bf67d8a7a
commit
243cbf0fc7
@ -7,7 +7,8 @@ import {
|
|||||||
ViewChild,
|
ViewChild,
|
||||||
OnDestroy,
|
OnDestroy,
|
||||||
ChangeDetectionStrategy,
|
ChangeDetectionStrategy,
|
||||||
ElementRef
|
ElementRef,
|
||||||
|
ChangeDetectorRef
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -146,6 +147,7 @@ export class MessagesComponent implements OnInit, OnDestroy {
|
|||||||
constructor(
|
constructor(
|
||||||
private logger: NGXLogger,
|
private logger: NGXLogger,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
|
private changeDetectorRef: ChangeDetectorRef,
|
||||||
private translateService: TranslateService
|
private translateService: TranslateService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
@ -157,12 +159,12 @@ export class MessagesComponent implements OnInit, OnDestroy {
|
|||||||
this.loginRes = loginRes;
|
this.loginRes = loginRes;
|
||||||
});
|
});
|
||||||
this.roomInfoSubscription = this.roomInfo$.subscribe(roomInfo => {
|
this.roomInfoSubscription = this.roomInfo$.subscribe(roomInfo => {
|
||||||
this.eventList = undefined;
|
// this.eventList = undefined;
|
||||||
this.newEventList = undefined;
|
// this.newEventList = undefined;
|
||||||
this.searchedList = undefined;
|
// this.searchedList = undefined;
|
||||||
this.eventInfoStatus = undefined;
|
// this.eventInfoStatus = undefined;
|
||||||
this.eventRemained = undefined;
|
// this.eventRemained = undefined;
|
||||||
this.userInfos = undefined;
|
// this.userInfos = undefined;
|
||||||
|
|
||||||
this.initEventMore();
|
this.initEventMore();
|
||||||
this.roomInfo = roomInfo;
|
this.roomInfo = roomInfo;
|
||||||
@ -180,6 +182,7 @@ export class MessagesComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.eventList = eventList;
|
this.eventList = eventList;
|
||||||
|
this.changeDetectorRef.detectChanges();
|
||||||
|
|
||||||
if (this.searchingMode) {
|
if (this.searchingMode) {
|
||||||
const baseseq = this.baseEventSeq;
|
const baseseq = this.baseEventSeq;
|
||||||
@ -284,6 +287,9 @@ export class MessagesComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getUnreadCount(message: Info<EventJson>): string | number {
|
getUnreadCount(message: Info<EventJson>): string | number {
|
||||||
|
// if (!this.userInfos || 0 === this.userInfos.length) {
|
||||||
|
// return '';
|
||||||
|
// }
|
||||||
const unreadCnt = this.userInfos.filter(user => {
|
const unreadCnt = this.userInfos.filter(user => {
|
||||||
if (message.senderSeq === user.seq) {
|
if (message.senderSeq === user.seq) {
|
||||||
// 본인 글은 unreadCount 에 포함하지 않는다.
|
// 본인 글은 unreadCount 에 포함하지 않는다.
|
||||||
@ -392,9 +398,6 @@ export class MessagesComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.scrollToBottom();
|
this.scrollToBottom();
|
||||||
// setTimeout(() => {
|
|
||||||
// this.chatMessagesContainer.nativeElement.classList.remove('hide');
|
|
||||||
// }, 100);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -433,23 +436,15 @@ export class MessagesComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
this.firstCheckReadHere = false;
|
this.firstCheckReadHere = false;
|
||||||
} else {
|
} else {
|
||||||
this.virtualScroller.scrollInto(
|
this.virtualScroller.scrollToIndex(
|
||||||
this.eventList[this.eventList.length - 1],
|
this.eventList.length - 1,
|
||||||
true,
|
true,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
() => {
|
() => {
|
||||||
if (!this.scrollUpInitalized) {
|
this.chatMessagesContainer.nativeElement.classList.remove('hide');
|
||||||
this.chatMessagesContainer.nativeElement.classList.remove(
|
|
||||||
'hide'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// setTimeout(() => {
|
|
||||||
// this.psChatContent.scrollToBottom(0, speed);
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user