From 97499b041549897c072309cad511bac86540814e Mon Sep 17 00:00:00 2001 From: richard-loafle <44828666+richard-loafle@users.noreply.github.com> Date: Thu, 23 Jan 2020 11:23:31 +0900 Subject: [PATCH] app exit is added --- .../ucap-webmessenger-electron/src/index.ts | 15 +- .../native/components/top-bar.component.html | 387 +++++++++--------- .../native/components/top-bar.component.ts | 4 + .../src/assets/i18n/en.json | 1 + .../src/assets/i18n/ko.json | 1 + .../lib/services/browser-native.service.ts | 2 + .../lib/services/electron-native.service.ts | 7 +- .../src/lib/types/channel.type.ts | 4 + .../src/lib/services/native.service.ts | 1 + 9 files changed, 233 insertions(+), 189 deletions(-) diff --git a/electron-projects/ucap-webmessenger-electron/src/index.ts b/electron-projects/ucap-webmessenger-electron/src/index.ts index 98110195..bec8dde9 100644 --- a/electron-projects/ucap-webmessenger-electron/src/index.ts +++ b/electron-projects/ucap-webmessenger-electron/src/index.ts @@ -28,7 +28,8 @@ import { NotificationChannel, ChatChannel, MessengerChannel, - MessageChannel + MessageChannel, + AppChannel } from '@ucap-webmessenger/native-electron'; import { ElectronNotificationService } from '@ucap-webmessenger/electron-notification'; import { ElectronUpdateWindowService } from '@ucap-webmessenger/electron-update-window'; @@ -231,8 +232,7 @@ function createTray() { // selector: 'terminate:', click: () => { // 메신저에 로그아웃 후 종료 - appWindow = null; - app.exit(); + appExit(); } } ]); @@ -715,6 +715,10 @@ ipcMain.on( } ); +ipcMain.on(AppChannel.Exit, (event: IpcMainEvent, ...args: any[]) => { + appExit(); +}); + autoUpdater.on('checking-for-update', () => { log.info('Checking for update...'); }); @@ -748,3 +752,8 @@ autoUpdater.on('update-downloaded', info => { updateWindowService.setDownloadComplete(); autoUpdater.quitAndInstall(true, true); }); + +function appExit() { + appWindow = null; + app.exit(); +} 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 346c6658..8b323ad3 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 @@ -257,27 +257,28 @@ yPosition="below" (closed)="onClosedProfileMenu($event)" > -
- -
-
- -
- -
- -
-
- -
-
- -
- -
- -
- -
- -
+
+ +
+
+ +
+
+ +
+ +
+ +
+ +
+ +
+
+ +
+ -
- -
-
- - -
-
- -
-
- -
-
- -
+ +
+ +
+
+ + +
+
+ +
+
+ +
+
+ +
+
-
- {{ 'presence.settingOfAwayTime' | translate }} -
- -
- - {{ awayTime }}{{ 'common.units.minute' | translate }} + +
+ {{ 'presence.settingOfAwayTime' | translate }}
- + +
+ + {{ awayTime + }}{{ 'common.units.minute' | translate }} +
+
+
-