From de0a6b016e14f9365e099e9c437d2554b68ccb0b Mon Sep 17 00:00:00 2001 From: leejinho Date: Fri, 31 Jan 2020 09:08:39 +0900 Subject: [PATCH] =?UTF-8?q?=EC=82=AC=EC=9A=A9=EC=9E=90=20=EA=B2=80?= =?UTF-8?q?=EC=83=89=20>=20=ED=94=84=EB=A1=9C=ED=95=84=20>=201:1=EB=8C=80?= =?UTF-8?q?=ED=99=94=20=ED=81=B4=EB=A6=AD=20>>=20=EB=AA=A8=EB=93=A0=20?= =?UTF-8?q?=ED=8C=9D=EC=97=85=EC=9D=84=20=EB=8B=AB=EC=95=84=EC=A3=BC?= =?UTF-8?q?=EB=8A=94=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dialogs/profile/profile.dialog.component.ts | 6 ++++-- .../search/integrated-search.dialog.component.ts | 10 ++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) 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 4f98cdc2..b06bcf1b 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 @@ -61,7 +61,9 @@ export interface ProfileDialogData { openProfileOptions?: OpenProfileOptions; } -export interface ProfileDialogResult {} +export interface ProfileDialogResult { + closeEvent?: string; +} @Component({ selector: 'app-profile.dialog', @@ -191,7 +193,7 @@ export class ProfileDialogComponent implements OnInit, OnDestroy { this.store.dispatch(ChatStore.openRoom({ userSeqList: [userInfo.seq] })); } - this.dialogRef.close(); + this.dialogRef.close({ closeEvent: 'CHAT' }); } onClickSendMessage(userInfo: UserInfoSS) { 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 7bb52df9..d96425c2 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 @@ -188,9 +188,9 @@ export class IntegratedSearchDialogComponent implements OnInit, OnDestroy { }) .pipe( take(1), - map(res => { + map(async res => { if (!!res && !!res.userInfo) { - this.dialogService.open< + const result = await this.dialogService.open< ProfileDialogComponent, ProfileDialogData, ProfileDialogResult @@ -199,6 +199,12 @@ export class IntegratedSearchDialogComponent implements OnInit, OnDestroy { userInfo: res.userInfo } }); + + if (!!result) { + if (!!result.closeEvent && result.closeEvent === 'CHAT') { + this.dialogRef.close({}); + } + } } }) )