diff --git a/electron-projects/ucap-webmessenger-electron/src/index.ts b/electron-projects/ucap-webmessenger-electron/src/index.ts index b8d3935b..73bbcf9e 100644 --- a/electron-projects/ucap-webmessenger-electron/src/index.ts +++ b/electron-projects/ucap-webmessenger-electron/src/index.ts @@ -47,7 +47,11 @@ import { } from '@ucap-webmessenger/native'; import { ElectronAppChannel } from '@ucap-webmessenger/electron-core'; -import { autoUpdater, CancellationToken } from 'electron-updater'; +import { + autoUpdater, + CancellationToken, + UpdateCheckResult +} from 'electron-updater'; import log from 'electron-log'; import { RendererUpdater } from './lib/renderer-updater'; @@ -124,6 +128,7 @@ let rendererUpdater: RendererUpdater | undefined; log.transports.file.level = 'debug'; let autoUpdaterCancellationToken: CancellationToken; +let updateCheckResult: UpdateCheckResult; autoUpdater.autoDownload = false; autoUpdater.logger = log; @@ -299,6 +304,8 @@ app.on(ElectronAppChannel.Ready, () => { }, onDenyUpdate: () => { log.info('OnDenyUpdate'); + + updateCheckResult.cancellationToken.cancel(); updateWindowService.close(); }, onCancelDownload: () => { @@ -353,20 +360,19 @@ function onDidLoad(fn: OnDidLoadFn) { } ipcMain.on(UpdaterChannel.Apply, (event: IpcMainEvent, ...args: any[]) => { - // if (__DEV__) { - // event.returnValue = false; - // return; - // } + if (!autoUpdater.isUpdaterActive()) { + log.info('autoUpdater is not active'); + return; + } const ver = args[0]; if (semver.lt(app.getVersion(), ver)) { - autoUpdater - .checkForUpdatesAndNotify() - .then(result => {}) - .catch(reason => { - log.error(reason); - }); + updateCheckResult = undefined; + autoUpdater.checkForUpdatesAndNotify().then(r => { + log.debug('checkForUpdatesAndNotify.then'); + updateCheckResult = r; + }); } }); @@ -770,6 +776,8 @@ autoUpdater.on('update-not-available', info => { log.info('Update not available.'); }); autoUpdater.on('error', err => { + updateWindowService.close(); + log.info('Error in auto-updater. ' + err); }); autoUpdater.on('download-progress', progressObj => { diff --git a/package.json b/package.json index 3f20a6b8..a2726d77 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ucap-webmessenger", - "version": "0.0.14", + "version": "0.0.15", "author": { "name": "LG CNS", "email": "lgucap@lgcns.com" diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.scss b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.scss index 555bb867..cc7b7a67 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.scss +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.scss @@ -174,11 +174,19 @@ } } -::ng-deep .chat-snackbar-class { - .mat-simple-snackbar { - justify-content: center; - span { - @include ellipsis(1); +::ng-deep .cdk-global-overlay-wrapper { + .mat-snack-bar-container { + margin: 0; + padding: 30px; + .mat-simple-snackbar { + justify-content: center; + span { + @include ellipsis(1); + padding: 10px 40px; + border: 1px solid #ffffff; + background-color: rgb(255, 255, 255, 0.2); + color: #ffffff; + } } } } diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts index 1af9a30a..1ebcf98d 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts @@ -970,13 +970,13 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { } if (result.canceled) { - this.snackBarService.open( - this.translateService.instant('common.file.results.canceled'), - this.translateService.instant('common.file.errors.label'), - { - duration: 1000 - } - ); + // this.snackBarService.open( + // this.translateService.instant('common.file.results.canceled'), + // this.translateService.instant('common.file.errors.label'), + // { + // duration: 1000 + // } + // ); } else { this.saveFile(value, result.filePath); } diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/album-box.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/album-box.component.html index e7046c96..9110e07e 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/album-box.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/album-box.component.html @@ -66,10 +66,19 @@ +
+ {{ 'common.file.errors.cantPlay' | translate }} +