bug fixed

This commit is contained in:
richard-loafle 2020-02-06 16:15:52 +09:00
parent 90918b3595
commit e518ed386e

View File

@ -425,7 +425,6 @@ export class MessagesComponent implements OnInit, OnDestroy {
useSwap: boolean,
addtionalOffset?: number
) {
if (!!to) {
this.preSwapScroll(useHide, useSwap);
if (!!preCallback) {
preCallback();
@ -449,15 +448,6 @@ export class MessagesComponent implements OnInit, OnDestroy {
});
}
);
} else {
if (!!preCallback) {
preCallback();
}
if (!!postCallback) {
postCallback();
}
}
}
preSwapScroll(useHide: boolean, useSwap: boolean) {
@ -540,6 +530,12 @@ export class MessagesComponent implements OnInit, OnDestroy {
return;
}
if (!!this.gotoEventSeq) {
this.gotoPosition(this.gotoEventSeq);
this.gotoEventSeq = undefined;
return;
}
const lastEvent =
!!this.eventList && 0 < this.eventList.length
? this.eventList[this.eventList.length - 1]
@ -550,20 +546,14 @@ export class MessagesComponent implements OnInit, OnDestroy {
}
const isInViewPortItems = this.isInViewPortItems(lastEvent.seq);
this.swapScrollTo(
!!this.gotoEventSeq
? undefined
: this.eventList[this.eventList.length - 1],
this.eventList[this.eventList.length - 1],
() => {},
() => {
this.initalized = true;
if (!!this.gotoEventSeq) {
this.gotoPosition(this.gotoEventSeq);
this.gotoEventSeq = undefined;
}
},
-1 === this.virtualScroller.viewPortInfo.endIndex ||
!isInViewPortItems,
!isInViewPortItems || !!this.gotoEventSeq
!isInViewPortItems
);
}
}