Merge branch 'master' of https://git.loafle.net/ucap-web/next-ucap-messenger
This commit is contained in:
commit
00e6df85d1
|
@ -51,7 +51,7 @@
|
||||||
"target": ["nsis-web"],
|
"target": ["nsis-web"],
|
||||||
"icon": "./config/build/win/icon/daesang/16x16.ico",
|
"icon": "./config/build/win/icon/daesang/16x16.ico",
|
||||||
"legalTrademarks": "(c) 2015 lgucap.com",
|
"legalTrademarks": "(c) 2015 lgucap.com",
|
||||||
"publisherName": "LGCNS",
|
"publisherName": "LG CNS Co.,Ltd",
|
||||||
"signingHashAlgorithms": ["sha1"],
|
"signingHashAlgorithms": ["sha1"],
|
||||||
"certificateFile": "./config/sign/www.lgcns.com.pfx",
|
"certificateFile": "./config/sign/www.lgcns.com.pfx",
|
||||||
"certificatePassword": "it15itsm",
|
"certificatePassword": "it15itsm",
|
||||||
|
|
|
@ -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__) {
|
// if (__DEV__) {
|
||||||
// event.returnValue = false;
|
// event.returnValue = false;
|
||||||
// return;
|
// return;
|
||||||
|
@ -365,18 +365,10 @@ ipcMain.on(UpdaterChannel.Check, (event: IpcMainEvent, ...args: any[]) => {
|
||||||
};
|
};
|
||||||
autoUpdater
|
autoUpdater
|
||||||
.checkForUpdatesAndNotify()
|
.checkForUpdatesAndNotify()
|
||||||
.then(result => {
|
.then(result => {})
|
||||||
if (!result) {
|
|
||||||
event.returnValue = false;
|
|
||||||
} else {
|
|
||||||
event.returnValue = true;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(reason => {
|
.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');
|
log.info('Update downloaded');
|
||||||
|
|
||||||
updateWindowService.setDownloadComplete();
|
updateWindowService.setDownloadComplete();
|
||||||
autoUpdater.quitAndInstall(true, true);
|
|
||||||
|
setTimeout(() => {
|
||||||
|
autoUpdater.quitAndInstall(true, true);
|
||||||
|
}, 2000);
|
||||||
});
|
});
|
||||||
|
|
||||||
function appExit() {
|
function appExit() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ucap-webmessenger",
|
"name": "ucap-webmessenger",
|
||||||
"version": "0.0.8",
|
"version": "0.0.9",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "LG CNS",
|
"name": "LG CNS",
|
||||||
"email": "lgucap@lgcns.com"
|
"email": "lgucap@lgcns.com"
|
||||||
|
|
|
@ -553,10 +553,6 @@ export class TopBarComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
onClickApplyUpdate(event: Event) {
|
onClickApplyUpdate(event: Event) {
|
||||||
this.nativeService
|
this.nativeService.checkForUpdates(this.checkingUpdateAppVersion);
|
||||||
.checkForUpdates(this.checkingUpdateAppVersion)
|
|
||||||
.then(e => {
|
|
||||||
this.logger.debug('onClickApplyUpdate');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,30 +128,15 @@ export class Effects {
|
||||||
() =>
|
() =>
|
||||||
this.actions$.pipe(
|
this.actions$.pipe(
|
||||||
ofType(webLoginSuccess),
|
ofType(webLoginSuccess),
|
||||||
switchMap(
|
tap(params => {
|
||||||
params =>
|
this.nativeService.checkForUpdates(params.login2Response.version);
|
||||||
new Observable<void>(subscriber => {
|
this.appAuthenticationService.login(
|
||||||
this.nativeService
|
params.loginInfo,
|
||||||
.checkForUpdates(params.login2Response.version)
|
params.rememberMe,
|
||||||
.then((update: boolean) => {
|
params.autoLogin
|
||||||
if (!update) {
|
);
|
||||||
this.appAuthenticationService.login(
|
this.router.navigate(['/messenger']);
|
||||||
params.loginInfo,
|
})
|
||||||
params.rememberMe,
|
|
||||||
params.autoLogin
|
|
||||||
);
|
|
||||||
this.router.navigate(['/messenger']);
|
|
||||||
}
|
|
||||||
subscriber.next();
|
|
||||||
})
|
|
||||||
.catch(reason => {
|
|
||||||
subscriber.error(reason);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
subscriber.complete();
|
|
||||||
});
|
|
||||||
})
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
{ dispatch: false }
|
{ dispatch: false }
|
||||||
);
|
);
|
||||||
|
|
|
@ -114,11 +114,7 @@ export class BrowserNativeService extends NativeService {
|
||||||
}
|
}
|
||||||
closeAllNotify(): void {}
|
closeAllNotify(): void {}
|
||||||
|
|
||||||
checkForUpdates(currentVersion: string): Promise<boolean> {
|
checkForUpdates(currentVersion: string): void {}
|
||||||
return new Promise<boolean>((resolve, reject) => {
|
|
||||||
resolve(false);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
checkForInstantUpdates(config: UpdateCheckConfig): Observable<UpdateInfo> {
|
checkForInstantUpdates(config: UpdateCheckConfig): Observable<UpdateInfo> {
|
||||||
return new Observable<UpdateInfo>(subscriber => {
|
return new Observable<UpdateInfo>(subscriber => {
|
||||||
|
|
|
@ -183,16 +183,8 @@ export class ElectronNativeService implements NativeService {
|
||||||
this.ipcRenderer.send(NotificationChannel.CloseAllNotify);
|
this.ipcRenderer.send(NotificationChannel.CloseAllNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkForUpdates(currentVersion: string): Promise<boolean> {
|
checkForUpdates(currentVersion: string): void {
|
||||||
return new Promise<boolean>((resolve, reject) => {
|
this.ipcRenderer.send(UpdaterChannel.Apply, currentVersion);
|
||||||
try {
|
|
||||||
resolve(
|
|
||||||
this.ipcRenderer.sendSync(UpdaterChannel.Check, currentVersion)
|
|
||||||
);
|
|
||||||
} catch (error) {
|
|
||||||
reject(error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
checkForInstantUpdates(config: UpdateCheckConfig): Observable<UpdateInfo> {
|
checkForInstantUpdates(config: UpdateCheckConfig): Observable<UpdateInfo> {
|
||||||
|
|
|
@ -23,7 +23,7 @@ export enum NotificationChannel {
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum UpdaterChannel {
|
export enum UpdaterChannel {
|
||||||
Check = 'UCAP::updater::check',
|
Apply = 'UCAP::updater::apply',
|
||||||
StartCheckInstant = 'UCAP::updater::startCheckInstant',
|
StartCheckInstant = 'UCAP::updater::startCheckInstant',
|
||||||
ExistInstant = 'UCAP::updater::existInstant',
|
ExistInstant = 'UCAP::updater::existInstant',
|
||||||
ApplyInstant = 'UCAP::updater::applyInstant',
|
ApplyInstant = 'UCAP::updater::applyInstant',
|
||||||
|
|
|
@ -36,7 +36,7 @@ export abstract class NativeService {
|
||||||
abstract notify(noti: NotificationRequest): void;
|
abstract notify(noti: NotificationRequest): void;
|
||||||
abstract closeAllNotify(): void;
|
abstract closeAllNotify(): void;
|
||||||
|
|
||||||
abstract checkForUpdates(currentVersion: string): Promise<boolean>;
|
abstract checkForUpdates(currentVersion: string): void;
|
||||||
abstract checkForInstantUpdates(
|
abstract checkForInstantUpdates(
|
||||||
config: UpdateCheckConfig
|
config: UpdateCheckConfig
|
||||||
): Observable<UpdateInfo>;
|
): Observable<UpdateInfo>;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user