bug fixed

This commit is contained in:
richard-loafle 2020-02-06 10:34:44 +09:00
parent 5d3938addd
commit 739925911d
2 changed files with 6 additions and 2 deletions

View File

@ -14,7 +14,7 @@
> >
<div #chatMessagesContainer class="chat-messages"> <div #chatMessagesContainer class="chat-messages">
<div <div
*ngIf="eventRemained && !!eventList && eventList.length > 0" *ngIf="initalized && eventRemained && !!eventList && eventList.length > 0"
class="message-row view-previous" class="message-row view-previous"
> >
<button mat-button (click)="onClickMore($event)" class="bg-accent-dark"> <button mat-button (click)="onClickMore($event)" class="bg-accent-dark">

View File

@ -155,6 +155,7 @@ export class MessagesComponent implements OnInit, OnDestroy {
existReadToHereEvent = true; existReadToHereEvent = true;
hidden = false; hidden = false;
swapped = false; swapped = false;
initalized = false;
constructor( constructor(
private logger: NGXLogger, private logger: NGXLogger,
@ -171,6 +172,7 @@ export class MessagesComponent implements OnInit, OnDestroy {
}); });
this.roomInfoSubscription = this.roomInfo$.subscribe(roomInfo => { this.roomInfoSubscription = this.roomInfo$.subscribe(roomInfo => {
this.roomInfo = roomInfo; this.roomInfo = roomInfo;
this.initalized = false;
/** [S] initializing by changed room */ /** [S] initializing by changed room */
// reset :: roomLastEventSeq // reset :: roomLastEventSeq
@ -532,7 +534,9 @@ export class MessagesComponent implements OnInit, OnDestroy {
this.swapScrollTo( this.swapScrollTo(
this.eventList[this.eventList.length - 1], this.eventList[this.eventList.length - 1],
() => {}, () => {},
() => {}, () => {
this.initalized = true;
},
-1 === this.virtualScroller.viewPortInfo.endIndex || -1 === this.virtualScroller.viewPortInfo.endIndex ||
!isInViewPortItems, !isInViewPortItems,
!isInViewPortItems !isInViewPortItems