From 856b553da23b9f7b4435babe17e56ca0b0dc3065 Mon Sep 17 00:00:00 2001 From: leejinho Date: Wed, 11 Mar 2020 17:01:44 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B8=B0=EB=B3=B8=20=EC=84=B8=ED=8C=85=20?= =?UTF-8?q?=ED=81=B4=EB=A6=AC=EC=96=B4=20&=20=EB=A1=9C=EA=B7=B8=EC=95=84?= =?UTF-8?q?=EC=9B=83=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80.=20>=20?= =?UTF-8?q?=EC=83=81=EB=8B=A8=20=ED=94=84=EB=A1=9C=ED=95=84=20=ED=81=B4?= =?UTF-8?q?=EB=A6=AD=20>=20=EB=B2=84=EC=A0=84=EC=A0=95=EB=B3=B4=20>=20?= =?UTF-8?q?=ED=98=84=EC=9E=AC=EB=B2=84=EC=A0=84=20=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EB=A7=88=EC=9A=B0=EC=8A=A4=20middle=20=ED=81=B4=EB=A6=AD=20>?= =?UTF-8?q?=20=EB=B2=84=ED=8A=BC=20=EB=85=B8=EC=B6=9C=EB=90=98=EB=A9=B4=20?= =?UTF-8?q?=ED=81=B4=EB=A6=AD.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../messenger-settings.dialog.component.html | 7 ---- .../messenger-settings.dialog.component.ts | 23 +---------- .../native/components/top-bar.component.html | 16 +++++++- .../native/components/top-bar.component.ts | 39 ++++++++++++++++++- 4 files changed, 52 insertions(+), 33 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/settings/messenger-settings.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/settings/messenger-settings.dialog.component.html index 35793d93..712babdf 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/settings/messenger-settings.dialog.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/settings/messenger-settings.dialog.component.html @@ -124,13 +124,6 @@ - + diff --git a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts index b387358c..1ebe5c2f 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.ts @@ -34,7 +34,10 @@ import { KEY_LOGIN_INFO, KEY_VER_INFO, EnvironmentsInfo, - KEY_ENVIRONMENTS_INFO + KEY_ENVIRONMENTS_INFO, + KEY_LOGIN_RES_INFO, + KEY_LOGOUT_INFO, + KEY_AUTH_INFO } from '@app/types'; import { WebLink, @@ -62,7 +65,12 @@ import { ProfileDialogResult, ProfileDialogData } from '@app/layouts/messenger/dialogs/profile/profile.dialog.component'; -import { DialogService } from '@ucap-webmessenger/ui'; +import { + DialogService, + ConfirmDialogComponent, + ConfirmDialogData, + ConfirmDialogResult +} from '@ucap-webmessenger/ui'; import { DOCUMENT } from '@angular/common'; import { MatMenu, MatMenuTrigger } from '@angular/material/menu'; import { StatusCode, StatusType, WindowUtil } from '@ucap-webmessenger/core'; @@ -663,4 +671,31 @@ export class TopBarComponent implements OnInit, OnDestroy { this.integratedSearchWord = ''; } + + async onClickClearSettingAndLogout() { + const result = await this.dialogService.open< + ConfirmDialogComponent, + ConfirmDialogData, + ConfirmDialogResult + >(ConfirmDialogComponent, { + width: '400px', + data: { + title: 'Clear & Logout?', + html: 'Clear General Setting And Logout?' + } + }); + + if (!!result && !!result.choice && result.choice) { + this.localStorageService.remove(KEY_APP_USER_INFO); + this.sessionStorageService.remove(KEY_LOGIN_RES_INFO); + this.sessionStorageService.remove(KEY_VER_INFO); + this.sessionStorageService.remove(KEY_LOGIN_INFO); + this.sessionStorageService.remove(KEY_URL_INFO); + this.sessionStorageService.remove(KEY_AUTH_INFO); + this.sessionStorageService.remove(KEY_LOGOUT_INFO); + this.nativeService.clearAppStorage(); + this.dialogService.closeAll(); + this.store.dispatch(AuthenticationStore.loginRedirect()); + } + } }