bug fixed

This commit is contained in:
richard-loafle 2020-02-05 12:06:58 +09:00
parent 74128a071a
commit 9e2a5bec76
2 changed files with 66 additions and 66 deletions

View File

@ -269,22 +269,29 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
this.roomInfoSubscription = this.store
.pipe(select(AppStore.MessengerSelector.RoomSelector.roomInfo))
.subscribe(roomInfo => {
this.clearView();
this.roomInfoSubject.next(roomInfo);
if (!!this.roomInfoSubject.value && !!this.interval) {
clearInterval(this.interval);
this.interval = undefined;
}
if (
!!this.roomInfoSubject.value &&
!!this.roomInfoSubject.value.isTimeRoom
!this.roomInfoSubject.value ||
(!!this.roomInfoSubject.value &&
this.roomInfoSubject.value.roomSeq !== roomInfo.roomSeq)
) {
this.interval = setInterval(() => {
this.store.dispatch(EventStore.infoIntervalClear({}));
}, 1000);
this.clearView();
if (!!this.roomInfoSubject.value && !!this.interval) {
clearInterval(this.interval);
this.interval = undefined;
}
if (
!!this.roomInfoSubject.value &&
!!this.roomInfoSubject.value.isTimeRoom
) {
this.interval = setInterval(() => {
this.store.dispatch(EventStore.infoIntervalClear({}));
}, 1000);
}
}
this.roomInfoSubject.next(roomInfo);
});
this.userInfoListSubscription = this.store
@ -326,57 +333,54 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
});
// [Daesang]
this.eventListSubscription = combineLatest([
this.store.pipe(
select(AppStore.MessengerSelector.EventSelector.selectAllInfoList)
),
this.store.pipe(select(AppStore.MessengerSelector.RoomSelector.roomInfo))
]).subscribe(([infoList, roomInfo]) => {
if (
!!this.eventListSubject.value &&
this.eventListSubject.value.length > 0
) {
this.eventListNewSubject.next(
infoList.filter(info => {
if (
info.seq <=
this.eventListSubject.value[
this.eventListSubject.value.length - 1
].seq
) {
return false;
}
return true;
})
);
this.eventListSubscription = this.store
.pipe(select(AppStore.MessengerSelector.EventSelector.selectAllInfoList))
.subscribe(infoList => {
if (
!!infoList &&
infoList.length > 0 &&
!!roomInfo &&
!!roomInfo.lastReadEventSeq &&
this.baseEventSeq <= roomInfo.lastReadEventSeq
!!this.eventListSubject.value &&
this.eventListSubject.value.length > 0
) {
// 조회된 내용중에 read here 가 있을 경우.
this.firstCheckReadHere = false;
this.eventListNewSubject.next(
infoList.filter(info => {
if (
info.seq <=
this.eventListSubject.value[
this.eventListSubject.value.length - 1
].seq
) {
return false;
}
return true;
})
);
if (
!!infoList &&
infoList.length > 0 &&
!!this.roomInfoSubject.value &&
!!this.roomInfoSubject.value.lastReadEventSeq &&
this.baseEventSeq <= this.roomInfoSubject.value.lastReadEventSeq
) {
// 조회된 내용중에 read here 가 있을 경우.
this.firstCheckReadHere = false;
}
}
}
this.eventListSubject.next(infoList);
this.eventListSubject.next(infoList);
if (this.moreSearchProcessing) {
const baseseq = this.baseEventSeq;
// setTimeout(() => {
// this.doSearchTextInEvent(this.searchText, baseseq);
// }, 800);
this.baseEventSeq = infoList[0].seq;
} else {
if (!!infoList && infoList.length > 0) {
if (this.moreSearchProcessing) {
const baseseq = this.baseEventSeq;
// setTimeout(() => {
// this.doSearchTextInEvent(this.searchText, baseseq);
// }, 800);
this.baseEventSeq = infoList[0].seq;
this.readyToReply();
} else {
if (!!infoList && infoList.length > 0) {
this.baseEventSeq = infoList[0].seq;
this.readyToReply();
}
}
}
});
});
// // [GROUP]
// this.eventListSubscription = this.store

View File

@ -169,14 +169,6 @@ export class MessagesComponent implements OnInit, OnDestroy {
this.loginRes = loginRes;
});
this.roomInfoSubscription = this.roomInfo$.subscribe(roomInfo => {
// this.eventList = undefined;
// this.newEventList = undefined;
// this.searchedList = undefined;
// this.eventInfoStatus = undefined;
// this.eventRemained = undefined;
// this.userInfos = undefined;
this.initEventMore();
this.roomInfo = roomInfo;
/** [S] initializing by changed room */
@ -188,6 +180,10 @@ export class MessagesComponent implements OnInit, OnDestroy {
this.readToHereEvent = undefined;
this.existReadToHereEvent = true;
/** [E] initializing by changed room */
if (this.roomInfo.roomSeq !== roomInfo.roomSeq) {
this.initEventMore();
}
});
this.eventListSubscription = this.eventList$.subscribe(eventList => {
this.eventList = eventList;
@ -529,7 +525,7 @@ export class MessagesComponent implements OnInit, OnDestroy {
this.eventList[this.eventList.length - 1],
() => {},
() => {},
true,
false,
false
);
} else {