diff --git a/projects/ucap-webmessenger-app/src/app/layouts/common/dialogs/file-viewer.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/common/dialogs/file-viewer.dialog.component.ts index 16e7b11c..489bd5fc 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/common/dialogs/file-viewer.dialog.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/common/dialogs/file-viewer.dialog.component.ts @@ -15,9 +15,6 @@ import { FileDownloadItem } from '@ucap-webmessenger/api'; import { CommonApiService } from '@ucap-webmessenger/api-common'; import { TranslateService } from '@ngx-translate/core'; import { FileProtocolService } from '@ucap-webmessenger/protocol-file'; -import { select, Store } from '@ngrx/store'; -import { Subscription } from 'rxjs'; -import * as AppStore from '@app/store'; export interface FileViewerDialogData { fileInfo: FileEventJson; @@ -35,8 +32,6 @@ export interface FileViewerDialogResult {} styleUrls: ['./file-viewer.dialog.component.scss'] }) export class FileViewerDialogComponent implements OnInit, OnDestroy { - loginResSubscription: Subscription; - fileInfo: FileEventJson; downloadUrl: string; userSeq: number; @@ -56,7 +51,6 @@ export class FileViewerDialogComponent implements OnInit, OnDestroy { private snackBarService: SnackBarService, private commonApiService: CommonApiService, private fileProtocolService: FileProtocolService, - private store: Store, private logger: NGXLogger ) { this.fileInfo = data.fileInfo; @@ -76,24 +70,9 @@ export class FileViewerDialogComponent implements OnInit, OnDestroy { ); } - ngOnInit() { - this.loginResSubscription = this.store - .pipe( - select(AppStore.AccountSelector.AuthenticationSelector.loginRes), - tap(loginRes => { - if (!loginRes) { - this.onClosedViewer(); - } - }) - ) - .subscribe(); - } + ngOnInit() {} - ngOnDestroy(): void { - if (!!this.loginResSubscription) { - this.loginResSubscription.unsubscribe(); - } - } + ngOnDestroy(): void {} onDownload(fileDownloadItem: FileDownloadItem): void { this.commonApiService diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.ts index 72c4aa1e..05a3d4c9 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/chat/create-chat.dialog.component.ts @@ -174,10 +174,6 @@ export class CreateChatDialogComponent implements OnInit, OnDestroy { .pipe( select(AppStore.AccountSelector.AuthenticationSelector.loginRes), tap(loginRes => { - if (!loginRes) { - this.onClickCancel(); - } - this.loginRes = loginRes; }) ) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/notice/notice-detail.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/notice/notice-detail.dialog.component.ts index 23f8e6a0..cf6f8fd1 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/notice/notice-detail.dialog.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/notice/notice-detail.dialog.component.ts @@ -1,10 +1,6 @@ import { Component, OnInit, Inject, OnDestroy } from '@angular/core'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; import { NoticeList } from '@ucap-webmessenger/api-message'; -import { Subscription } from 'rxjs'; -import { select, Store } from '@ngrx/store'; -import { tap } from 'rxjs/operators'; -import * as AppStore from '@app/store'; export interface NoticeDetailDialogData { notice: NoticeList; @@ -18,35 +14,17 @@ export interface NoticeDetailDialogResult {} styleUrls: ['./notice-detail.dialog.component.scss'] }) export class NoticeDetailDialogComponent implements OnInit, OnDestroy { - loginResSubscription: Subscription; - constructor( public dialogRef: MatDialogRef< NoticeDetailDialogData, NoticeDetailDialogResult >, - @Inject(MAT_DIALOG_DATA) public data: NoticeDetailDialogData, - private store: Store + @Inject(MAT_DIALOG_DATA) public data: NoticeDetailDialogData ) {} - ngOnInit() { - this.loginResSubscription = this.store - .pipe( - select(AppStore.AccountSelector.AuthenticationSelector.loginRes), - tap(loginRes => { - if (!loginRes) { - this.onClickConfirm(); - } - }) - ) - .subscribe(); - } + ngOnInit() {} - ngOnDestroy(): void { - if (!!this.loginResSubscription) { - this.loginResSubscription.unsubscribe(); - } - } + ngOnDestroy(): void {} onClickConfirm(): void { this.dialogRef.close(); diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/profile/profile.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/profile/profile.dialog.component.ts index ba5171b9..b2ba121b 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/profile/profile.dialog.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/profile/profile.dialog.component.ts @@ -119,10 +119,6 @@ export class ProfileDialogComponent implements OnInit, OnDestroy { .pipe( select(AppStore.AccountSelector.AuthenticationSelector.loginRes), tap(loginRes => { - if (!loginRes) { - this.onClose(); - } - this.loginRes = loginRes; if (!!loginRes && loginRes.userSeq === this.data.userInfo.seq) { this.isMe = true; diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/search/integrated-search.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/search/integrated-search.dialog.component.ts index cbb4f68a..d3473bfe 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/search/integrated-search.dialog.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/search/integrated-search.dialog.component.ts @@ -86,9 +86,6 @@ export class IntegratedSearchDialogComponent implements OnInit, OnDestroy { .pipe( select(AppStore.AccountSelector.AuthenticationSelector.loginRes), tap(loginRes => { - if (!loginRes) { - this.onCancel(); - } this.loginRes = loginRes; }) )