팝업 닫는 로직 통합에 의한 불필요 소스 제거.

This commit is contained in:
leejinho 2020-02-04 13:37:56 +09:00
parent ad78e23303
commit b58e52325d
5 changed files with 5 additions and 59 deletions

View File

@ -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<any>,
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

View File

@ -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;
})
)

View File

@ -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<any>
@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();

View File

@ -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;

View File

@ -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;
})
)