diff --git a/electron-projects/ucap-webmessenger-electron/src/index.ts b/electron-projects/ucap-webmessenger-electron/src/index.ts index 6ce956ca..b5c5bf95 100644 --- a/electron-projects/ucap-webmessenger-electron/src/index.ts +++ b/electron-projects/ucap-webmessenger-electron/src/index.ts @@ -166,6 +166,7 @@ function createTray() { // accelerator: 'Q', // selector: 'terminate:', click: () => { + appWindow.show(); appWindow.browserWindow.webContents.send(MessengerChannel.Logout); } }, diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html index b91ef75e..266a25f5 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html @@ -109,9 +109,8 @@ - + - + --> + {{ data.title }} @@ -28,101 +28,4 @@ Yes - ---> - - - 설정 - - - - - - - - 일반 - - - - - - - 개인정보취급방침 - - - - - - - 알림 - - - - - - - 장치 - - - - - - - 사용권한 - - - - - - - 통화 - - - - - - - - - - - No - - - Yes - - \ No newline at end of file diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/group/edit-group.dialog.component.scss b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/group/edit-group.dialog.component.scss index e56eb9dc..3314d0e5 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/group/edit-group.dialog.component.scss +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/group/edit-group.dialog.component.scss @@ -1,4 +1,4 @@ -/*::ng-deep .mat-card-header-tex{ +::ng-deep .mat-card-header-tex{ margin:0; } .confirm-card{ @@ -23,108 +23,4 @@ form{ .mat-form-field{ width:100%; } -}*/ - - -::ng-deep .cdk-overlay-pane { - width: 600px; - max-height: 90%; - height:800px; -} - -::ng-deep .setting-frame{ - padding: 16px; - height:100%; - min-width: 500px; - position: relative; - - .mat-dialog-container { - position: relative; - } - - .mat-card-header { - position: relative; - width: 100%; - border-bottom:1px solid #dddddd; - margin-bottom: 12px; - } - - .mat-card-content { - flex: 0 0 auto; - display: flex; - align-items: flex-start; - height: calc(100% - 100px); - border-bottom:1px solid #dddddd; - .setting-tab{ - position: relative; - width:100%; - height:100%; - .mat-tab-body-wrapper{ - border-left:1px solid #dddddd; - position: relative; - height:100%; - padding: 0 0 10px 10px; - - } - } - } - - .button-farm { - text-align: right; - position: absolute; - width: 100%; - bottom: 10px; - .mat-primary { - margin-left: 4px; - } - } -} - -::ng-deep .setting-tab{ - .mat-tab-group{ - position: relative; - height:100%; - width:100%; - .mat-tab-header{ - .mat-tab-label-container{ - .mat-tab-list{ - .mat-tab-labels{ - border-bottom:0; - padding-right:10px; - .mat-tab-label{ - padding:0 10px; - } - } - } - } - } - - .mat-tab-body-wrapper{ - .mat-tab-body{ - .mat-tab-body-conten{ - position:relative; - width:100%; - height:100%; - .mat-list-base{ - position:relative; - .mat-list-option{ - height:40px; - } - } - } - } - } - } -} - -::ng-deep .setting-category{ - .mat-list-base{ - position:relative; - .mat-list-item{ - font-size:15px; - - } - .mat-divider{ - } - } } \ No newline at end of file diff --git a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html index bf54cbdb..2c5edb47 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html @@ -4,7 +4,7 @@ UCAP M Messenger - + ; WindowState = WindowState; + loginRes: LoginResponse; + loginResSubscription: Subscription; constructor( private store: Store, @@ -27,6 +33,15 @@ export class TopBarComponent implements OnInit, OnDestroy { ngOnInit() { this.windowStateChanged$ = this.nativeService.windowStateChanged(); + + this.loginResSubscription = this.store + .pipe( + select(AppStore.AccountSelector.AuthenticationSelector.loginRes), + tap(loginRes => { + this.loginRes = loginRes; + }) + ) + .subscribe(); } ngOnDestroy(): void {} @@ -48,6 +63,6 @@ export class TopBarComponent implements OnInit, OnDestroy { } onClickLogout(): void { - this.store.dispatch(AuthenticationStore.logout()); + this.store.dispatch(AuthenticationStore.logoutConfirmation()); } } diff --git a/projects/ucap-webmessenger-app/src/app/services/authentication.service.ts b/projects/ucap-webmessenger-app/src/app/services/authentication.service.ts index 454431f6..53304f6e 100644 --- a/projects/ucap-webmessenger-app/src/app/services/authentication.service.ts +++ b/projects/ucap-webmessenger-app/src/app/services/authentication.service.ts @@ -8,6 +8,8 @@ import { } from '@ucap-webmessenger/web-storage'; import { LocaleCode } from '@ucap-webmessenger/core'; import { LoginInfo, KEY_LOGIN_INFO } from '../types'; +import { KEY_VER_INFO } from '@app/types/ver-info.type'; +import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type'; @Injectable({ providedIn: 'root' @@ -44,6 +46,8 @@ export class AppAuthenticationService { } logout() { + this.sessionStorageService.remove(KEY_LOGIN_RES_INFO); + this.sessionStorageService.remove(KEY_VER_INFO); this.sessionStorageService.remove(KEY_LOGIN_INFO); } } diff --git a/projects/ucap-webmessenger-app/src/app/services/native.service.ts b/projects/ucap-webmessenger-app/src/app/services/native.service.ts index a30088b1..1eb7f86a 100644 --- a/projects/ucap-webmessenger-app/src/app/services/native.service.ts +++ b/projects/ucap-webmessenger-app/src/app/services/native.service.ts @@ -18,7 +18,7 @@ export class AppNativeService { subscribe(): void { this.nativeService.logout().subscribe(() => { - this.store.dispatch(AuthenticationStore.logout()); + this.store.dispatch(AuthenticationStore.logoutConfirmation()); }); this.nativeService.changeStatus().subscribe(statusCode => {}); this.nativeService.showSetting().subscribe(() => { diff --git a/projects/ucap-webmessenger-app/src/app/store/account/authentication/effects.ts b/projects/ucap-webmessenger-app/src/app/store/account/authentication/effects.ts index b3da389c..c1b40ef0 100644 --- a/projects/ucap-webmessenger-app/src/app/store/account/authentication/effects.ts +++ b/projects/ucap-webmessenger-app/src/app/store/account/authentication/effects.ts @@ -53,7 +53,11 @@ import { ServiceProtocolService, UserPasswordSetResponse } from '@ucap-webmessenger/protocol-service'; -import { AuthenticationProtocolService } from '@ucap-webmessenger/protocol-authentication'; +import { + AuthenticationProtocolService, + LoginResponse +} from '@ucap-webmessenger/protocol-authentication'; +import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type'; @Injectable() export class Effects { @@ -157,19 +161,26 @@ export class Effects { this.actions$.pipe( ofType(logoutConfirmation), exhaustMap(async () => { - const result = await this.dialogService.open< - ConfirmDialogComponent, - ConfirmDialogData, - ConfirmDialogResult - >(ConfirmDialogComponent, { - width: '220px', - data: { - title: 'Logout', - message: 'Logout ?' - } - }); + const loginRes = this.sessionStorageService.get( + KEY_LOGIN_RES_INFO + ); - return result.choice; + if (!!loginRes && loginRes.userSeq) { + const result = await this.dialogService.open< + ConfirmDialogComponent, + ConfirmDialogData, + ConfirmDialogResult + >(ConfirmDialogComponent, { + data: { + title: 'Logout', + message: '로그아웃 하시겠습니까?' + } + }); + + return result.choice; + } else { + return false; + } }), map(result => (result ? logout() : logoutConfirmationDismiss())) ) diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/settings/effects.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/settings/effects.ts index 32442fd3..4087323e 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/settings/effects.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/settings/effects.ts @@ -15,6 +15,9 @@ import { MessengerSettingsDialogData, MessengerSettingsDialogResult } from '@app/layouts/messenger/dialogs/settings/messenger-settings.dialog.component'; +import { SessionStorageService } from '@ucap-webmessenger/web-storage'; +import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; +import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type'; @Injectable() export class Effects { @@ -23,18 +26,24 @@ export class Effects { this.actions$.pipe( ofType(showDialog), tap(async () => { - const result = await this.dialogService.open< - MessengerSettingsDialogComponent, - MessengerSettingsDialogData, - MessengerSettingsDialogResult - >(MessengerSettingsDialogComponent, { - width: '800px', - maxWidth: '800px', - height: '800px', - minHeight: '800px', - disableClose: false, - data: {} - }); + const loginRes = this.sessionStorageService.get( + KEY_LOGIN_RES_INFO + ); + + if (!!loginRes && loginRes.userSeq) { + const result = await this.dialogService.open< + MessengerSettingsDialogComponent, + MessengerSettingsDialogData, + MessengerSettingsDialogResult + >(MessengerSettingsDialogComponent, { + width: '800px', + maxWidth: '800px', + height: '800px', + minHeight: '800px', + disableClose: false, + data: {} + }); + } }) ), { dispatch: false } @@ -44,6 +53,7 @@ export class Effects { private actions$: Actions, private store: Store, private dialogService: DialogService, - private logger: NGXLogger + private logger: NGXLogger, + private sessionStorageService: SessionStorageService ) {} }