팝업 닫는 로직 통합에 의한 불필요 소스 제거.
This commit is contained in:
parent
ad78e23303
commit
b58e52325d
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
})
|
||||
)
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
})
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user