Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ngOnInit(): void {
this.sup.add(this.actions$.pipe(
ofActionCompleted(GotHubChatProblem)
).subscribe(() => {
// Display error about chat server's problem
}))
this.sup.add(
this.actions$.pipe(
ofActionSuccessful(ActiveDoubleChatRoom),
).subscribe(
() => {
if(!this.isShowChatBox)
this.isShowChatBox = true
}
)
)
this.sup.add(this.chatState$.pipe(
filter(state => ObjectUtils.isNotNull(state.currentUser)),
tap(
)
)
this.sup.add(
this.action$.pipe(
ofActionCompleted(DroppedCall)
).subscribe(
() => {
this.closed()
}
)
)
this.sup.add(
this.action$.pipe(
ofActionCompleted(UserCancelledCall)
).subscribe(
() => {
// Caller is cancelled a call when he is dialing
// So we drop the call as well
this.shortcutUtil.toastMessage('User ended a call', ToastType.Warning)
this.store.dispatch(new DroppedCall())
this.dialogRef.close()
}
)
)
}
)
this.sup.add(
this.action$.pipe(
ofActionCompleted(UserDroppedCall)
).subscribe(
() => {
this.allowDisplayToastError = false
this.closed()
}
)
)
this.sup.add(
this.action$.pipe(
ofActionCompleted(DroppedCall)
).subscribe(
() => {
this.closed()
}
)
)
this.sup.add(
this.action$.pipe(
ofActionCompleted(UserCancelledCall)
).subscribe(
() => {
// Caller is cancelled a call when he is dialing
// So we drop the call as well
this.shortcutUtil.toastMessage('User ended a call', ToastType.Warning)
this.store.dispatch(new DroppedCall())
).subscribe(
() => {
this.iceServers = this.store.selectSnapshot(CHAT_STATE_TOKEN).iceServers
this.initRtcConnect(
this.iceServers,
this.handshakedRoom.id,
this.handshakedRoom.participants.find(a => a.username === this.invitee.userName).connectionId
)
}
)
)
this.sup.add(
this.actions$.pipe(
ofActionCompleted(UserDroppedCall)
).subscribe(
() => {
this.shortcutUtil.toastMessage(this.translate.instant('chats.videoCall.messages.userEndCall'), ToastType.Warning)
this.dropAll()
}
)
)
}
private subscribeToActionCompleted(): void {
this.actions$
.pipe(
ofActionCompleted(LoadContent),
takeUntil(this.unsubscriber$)
)
.subscribe(() => {
this.inProgress = false;
});
}
this.action$.pipe(
ofActionSuccessful(UserDeniedCall)
).subscribe(
() => {
clearInterval(this.animationInterval)
if (this.allowDisplayToastError) {
this.shortcutUtil.toastMessage('User rejected a call', ToastType.Warning)
}
this.store.dispatch(new DroppedCall())
this.dialogRef.close()
})
)
this.sup.add(
this.action$.pipe(
ofActionCompleted(UserDroppedCall)
).subscribe(
() => {
this.allowDisplayToastError = false
this.closed()
}
)
)
this.sup.add(
this.action$.pipe(
ofActionCompleted(DroppedCall)
).subscribe(
() => {
this.closed()
}
)