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

View File

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