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,8 +269,12 @@ 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 => {
if (
!this.roomInfoSubject.value ||
(!!this.roomInfoSubject.value &&
this.roomInfoSubject.value.roomSeq !== roomInfo.roomSeq)
) {
this.clearView(); this.clearView();
this.roomInfoSubject.next(roomInfo);
if (!!this.roomInfoSubject.value && !!this.interval) { if (!!this.roomInfoSubject.value && !!this.interval) {
clearInterval(this.interval); clearInterval(this.interval);
@ -285,6 +289,9 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
this.store.dispatch(EventStore.infoIntervalClear({})); this.store.dispatch(EventStore.infoIntervalClear({}));
}, 1000); }, 1000);
} }
}
this.roomInfoSubject.next(roomInfo);
}); });
this.userInfoListSubscription = this.store this.userInfoListSubscription = this.store
@ -326,12 +333,9 @@ 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 ( if (
!!this.eventListSubject.value && !!this.eventListSubject.value &&
this.eventListSubject.value.length > 0 this.eventListSubject.value.length > 0
@ -353,9 +357,9 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
if ( if (
!!infoList && !!infoList &&
infoList.length > 0 && infoList.length > 0 &&
!!roomInfo && !!this.roomInfoSubject.value &&
!!roomInfo.lastReadEventSeq && !!this.roomInfoSubject.value.lastReadEventSeq &&
this.baseEventSeq <= roomInfo.lastReadEventSeq this.baseEventSeq <= this.roomInfoSubject.value.lastReadEventSeq
) { ) {
// 조회된 내용중에 read here 가 있을 경우. // 조회된 내용중에 read here 가 있을 경우.
this.firstCheckReadHere = false; this.firstCheckReadHere = false;

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 {