diff --git a/electron-builder.json b/electron-builder.json index 920e350c..ddc53c77 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -51,7 +51,7 @@ "target": ["nsis-web"], "icon": "./config/build/win/icon/daesang/16x16.ico", "legalTrademarks": "(c) 2015 lgucap.com", - "publisherName": "LGCNS", + "publisherName": "LG CNS Co.,Ltd", "signingHashAlgorithms": ["sha1"], "certificateFile": "./config/sign/www.lgcns.com.pfx", "certificatePassword": "it15itsm", diff --git a/electron-projects/ucap-webmessenger-electron/src/index.ts b/electron-projects/ucap-webmessenger-electron/src/index.ts index bec8dde9..c2f5b955 100644 --- a/electron-projects/ucap-webmessenger-electron/src/index.ts +++ b/electron-projects/ucap-webmessenger-electron/src/index.ts @@ -350,7 +350,7 @@ function onDidLoad(fn: OnDidLoadFn) { } } -ipcMain.on(UpdaterChannel.Check, (event: IpcMainEvent, ...args: any[]) => { +ipcMain.on(UpdaterChannel.Apply, (event: IpcMainEvent, ...args: any[]) => { // if (__DEV__) { // event.returnValue = false; // return; @@ -365,18 +365,10 @@ ipcMain.on(UpdaterChannel.Check, (event: IpcMainEvent, ...args: any[]) => { }; autoUpdater .checkForUpdatesAndNotify() - .then(result => { - if (!result) { - event.returnValue = false; - } else { - event.returnValue = true; - } - }) + .then(result => {}) .catch(reason => { - event.returnValue = false; + log.error(reason); }); - } else { - event.returnValue = false; } }); @@ -750,7 +742,10 @@ autoUpdater.on('update-downloaded', info => { log.info('Update downloaded'); updateWindowService.setDownloadComplete(); - autoUpdater.quitAndInstall(true, true); + + setTimeout(() => { + autoUpdater.quitAndInstall(true, true); + }, 2000); }); function appExit() { diff --git a/package.json b/package.json index cfe5c719..e11311a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ucap-webmessenger", - "version": "0.0.8", + "version": "0.0.9", "author": { "name": "LG CNS", "email": "lgucap@lgcns.com" 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 021a4412..f60f6e89 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 @@ -553,10 +553,6 @@ export class TopBarComponent implements OnInit, OnDestroy { } onClickApplyUpdate(event: Event) { - this.nativeService - .checkForUpdates(this.checkingUpdateAppVersion) - .then(e => { - this.logger.debug('onClickApplyUpdate'); - }); + this.nativeService.checkForUpdates(this.checkingUpdateAppVersion); } } 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 3926db44..3d00ab0b 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 @@ -128,30 +128,15 @@ export class Effects { () => this.actions$.pipe( ofType(webLoginSuccess), - switchMap( - params => - new Observable(subscriber => { - this.nativeService - .checkForUpdates(params.login2Response.version) - .then((update: boolean) => { - if (!update) { - this.appAuthenticationService.login( - params.loginInfo, - params.rememberMe, - params.autoLogin - ); - this.router.navigate(['/messenger']); - } - subscriber.next(); - }) - .catch(reason => { - subscriber.error(reason); - }) - .finally(() => { - subscriber.complete(); - }); - }) - ) + tap(params => { + this.nativeService.checkForUpdates(params.login2Response.version); + this.appAuthenticationService.login( + params.loginInfo, + params.rememberMe, + params.autoLogin + ); + this.router.navigate(['/messenger']); + }) ), { dispatch: false } ); diff --git a/projects/ucap-webmessenger-native-browser/src/lib/services/browser-native.service.ts b/projects/ucap-webmessenger-native-browser/src/lib/services/browser-native.service.ts index 5acb611f..4bbbc99f 100644 --- a/projects/ucap-webmessenger-native-browser/src/lib/services/browser-native.service.ts +++ b/projects/ucap-webmessenger-native-browser/src/lib/services/browser-native.service.ts @@ -114,11 +114,7 @@ export class BrowserNativeService extends NativeService { } closeAllNotify(): void {} - checkForUpdates(currentVersion: string): Promise { - return new Promise((resolve, reject) => { - resolve(false); - }); - } + checkForUpdates(currentVersion: string): void {} checkForInstantUpdates(config: UpdateCheckConfig): Observable { return new Observable(subscriber => { diff --git a/projects/ucap-webmessenger-native-electron/src/lib/services/electron-native.service.ts b/projects/ucap-webmessenger-native-electron/src/lib/services/electron-native.service.ts index 4ef37352..c54ae3ab 100644 --- a/projects/ucap-webmessenger-native-electron/src/lib/services/electron-native.service.ts +++ b/projects/ucap-webmessenger-native-electron/src/lib/services/electron-native.service.ts @@ -183,16 +183,8 @@ export class ElectronNativeService implements NativeService { this.ipcRenderer.send(NotificationChannel.CloseAllNotify); } - checkForUpdates(currentVersion: string): Promise { - return new Promise((resolve, reject) => { - try { - resolve( - this.ipcRenderer.sendSync(UpdaterChannel.Check, currentVersion) - ); - } catch (error) { - reject(error); - } - }); + checkForUpdates(currentVersion: string): void { + this.ipcRenderer.send(UpdaterChannel.Apply, currentVersion); } checkForInstantUpdates(config: UpdateCheckConfig): Observable { diff --git a/projects/ucap-webmessenger-native-electron/src/lib/types/channel.type.ts b/projects/ucap-webmessenger-native-electron/src/lib/types/channel.type.ts index f9f210de..8cdf96a8 100644 --- a/projects/ucap-webmessenger-native-electron/src/lib/types/channel.type.ts +++ b/projects/ucap-webmessenger-native-electron/src/lib/types/channel.type.ts @@ -23,7 +23,7 @@ export enum NotificationChannel { } export enum UpdaterChannel { - Check = 'UCAP::updater::check', + Apply = 'UCAP::updater::apply', StartCheckInstant = 'UCAP::updater::startCheckInstant', ExistInstant = 'UCAP::updater::existInstant', ApplyInstant = 'UCAP::updater::applyInstant', diff --git a/projects/ucap-webmessenger-native/src/lib/services/native.service.ts b/projects/ucap-webmessenger-native/src/lib/services/native.service.ts index 55334b9c..43cc5328 100644 --- a/projects/ucap-webmessenger-native/src/lib/services/native.service.ts +++ b/projects/ucap-webmessenger-native/src/lib/services/native.service.ts @@ -36,7 +36,7 @@ export abstract class NativeService { abstract notify(noti: NotificationRequest): void; abstract closeAllNotify(): void; - abstract checkForUpdates(currentVersion: string): Promise; + abstract checkForUpdates(currentVersion: string): void; abstract checkForInstantUpdates( config: UpdateCheckConfig ): Observable;