bugfix :: timer room event clear

This commit is contained in:
leejinho 2020-02-03 08:49:10 +09:00
parent eaadd72e89
commit 5f4aecfe57

View File

@ -265,6 +265,20 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
.subscribe(roomInfo => { .subscribe(roomInfo => {
this.clearView(); this.clearView();
this.roomInfoSubject.next(roomInfo); 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.interval = setInterval(() => {
this.store.dispatch(EventStore.infoIntervalClear({}));
}, 1000);
}
}); });
this.userInfoListSubscription = this.store this.userInfoListSubscription = this.store
@ -393,15 +407,6 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
} }
} }
}); });
if (
!!this.roomInfoSubject.value &&
!!this.roomInfoSubject.value.isTimeRoom
) {
this.interval = setInterval(() => {
this.store.dispatch(EventStore.infoIntervalClear({}));
}, 1000);
}
} }
ngOnDestroy(): void { ngOnDestroy(): void {