This commit is contained in:
leejinho 2020-01-23 14:45:29 +09:00
commit 00e6df85d1
9 changed files with 24 additions and 60 deletions

View File

@ -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",

View File

@ -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() {

View File

@ -1,6 +1,6 @@
{
"name": "ucap-webmessenger",
"version": "0.0.8",
"version": "0.0.9",
"author": {
"name": "LG CNS",
"email": "lgucap@lgcns.com"

View File

@ -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);
}
}

View File

@ -128,30 +128,15 @@ export class Effects {
() =>
this.actions$.pipe(
ofType(webLoginSuccess),
switchMap(
params =>
new Observable<void>(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 }
);

View File

@ -114,11 +114,7 @@ export class BrowserNativeService extends NativeService {
}
closeAllNotify(): void {}
checkForUpdates(currentVersion: string): Promise<boolean> {
return new Promise<boolean>((resolve, reject) => {
resolve(false);
});
}
checkForUpdates(currentVersion: string): void {}
checkForInstantUpdates(config: UpdateCheckConfig): Observable<UpdateInfo> {
return new Observable<UpdateInfo>(subscriber => {

View File

@ -183,16 +183,8 @@ export class ElectronNativeService implements NativeService {
this.ipcRenderer.send(NotificationChannel.CloseAllNotify);
}
checkForUpdates(currentVersion: string): Promise<boolean> {
return new Promise<boolean>((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<UpdateInfo> {

View File

@ -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',

View File

@ -36,7 +36,7 @@ export abstract class NativeService {
abstract notify(noti: NotificationRequest): void;
abstract closeAllNotify(): void;
abstract checkForUpdates(currentVersion: string): Promise<boolean>;
abstract checkForUpdates(currentVersion: string): void;
abstract checkForInstantUpdates(
config: UpdateCheckConfig
): Observable<UpdateInfo>;