Merge branch 'master' of http://10.81.13.221:6990/Web/next-ucap-messenger
This commit is contained in:
commit
bb4cdfab26
|
@ -95,6 +95,7 @@
|
|||
<perfect-scrollbar
|
||||
fxFlex="1 1 auto"
|
||||
#psChatContent
|
||||
(psScrollUp)="scrollUpinit = true"
|
||||
(psYReachStart)="onScrollup($event)"
|
||||
>
|
||||
<ucap-chat-messages
|
||||
|
|
|
@ -113,10 +113,13 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
userInfoListSubscription: Subscription;
|
||||
eventListProcessing$: Observable<boolean>;
|
||||
eventInfoStatus$: Observable<InfoResponse>;
|
||||
eventRemain$: Observable<boolean>;
|
||||
eventRemain = false;
|
||||
sessionVerInfo: VersionInfo2Response;
|
||||
|
||||
eventRemain$: Observable<boolean>;
|
||||
eventRemain = false; // 이전대화가 남아 있는지 여부
|
||||
eventMorePosition = 0; // 이전대화를 불러올 경우 현재 스크롤 포지션 유지를 위한 값. 0 이면 초기로딩.
|
||||
scrollUpinit = false; // ps 에서 초기 로딩시 scroll reach start 이벤트 발생 버그를 우회하기 위한 init 값으로 scrollUp 에 의해 true 로 된다.
|
||||
|
||||
isRecalledMessage = isRecalled;
|
||||
isCopyableMessage = isCopyable;
|
||||
isRecallableMessage = isRecallable;
|
||||
|
@ -157,6 +160,10 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
select(AppStore.MessengerSelector.RoomSelector.roomInfo),
|
||||
tap(roomInfo => {
|
||||
this.roomInfo = roomInfo;
|
||||
|
||||
// 방정보가 바뀌면 이전대화 보기 관련 값들을 초기화 한다.
|
||||
this.scrollUpinit = false;
|
||||
this.eventMorePosition = 0;
|
||||
})
|
||||
)
|
||||
.subscribe();
|
||||
|
@ -217,7 +224,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
}
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
this.readyToReply();
|
||||
// this.readyToReply();
|
||||
}
|
||||
|
||||
getRoomName() {
|
||||
|
@ -298,6 +305,21 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
}
|
||||
|
||||
scrollToBottom(speed?: number): void {
|
||||
if (this.eventMorePosition > 0) {
|
||||
if (this.psChatContent.directiveRef) {
|
||||
this.psChatContent.directiveRef.update();
|
||||
|
||||
setTimeout(() => {
|
||||
this.psChatContent.directiveRef.scrollToTop(
|
||||
this.psChatContent.directiveRef.elementRef.nativeElement
|
||||
.scrollHeight - this.eventMorePosition,
|
||||
speed
|
||||
);
|
||||
|
||||
this.scrollUpinit = false;
|
||||
});
|
||||
}
|
||||
} else {
|
||||
speed = speed || 0;
|
||||
if (this.psChatContent.directiveRef) {
|
||||
this.psChatContent.directiveRef.update();
|
||||
|
@ -307,6 +329,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async onSendMessage(message: string) {
|
||||
if (!message || message.trim().length === 0) {
|
||||
|
@ -360,7 +383,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
}
|
||||
/** More Event */
|
||||
onMoreEvent(seq: number) {
|
||||
if (this.eventRemain) {
|
||||
if (this.scrollUpinit && this.eventRemain) {
|
||||
this.store.dispatch(
|
||||
EventStore.info({
|
||||
roomSeq: this.roomInfo.roomSeq,
|
||||
|
@ -368,6 +391,8 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
requestCount: CONST.EVENT_INFO_READ_COUNT
|
||||
})
|
||||
);
|
||||
this.scrollUpinit = false;
|
||||
this.eventMorePosition = this.psChatContent.directiveRef.elementRef.nativeElement.scrollHeight;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user