From 324e2228ed8fcb891b7f78a1dd59b79191f0d2b7 Mon Sep 17 00:00:00 2001 From: richard-loafle <44828666+richard-loafle@users.noreply.github.com> Date: Wed, 5 Feb 2020 16:18:17 +0900 Subject: [PATCH 1/6] bug fixed --- .../ucap-webmessenger-electron/src/index.ts | 30 ++++++++++++------- package.json | 2 +- .../native/components/top-bar.component.html | 9 ++++-- .../native/components/top-bar.component.ts | 10 +++++-- .../components/my-profile-widget.component.ts | 3 +- .../src/public-api.ts | 2 ++ 6 files changed, 38 insertions(+), 18 deletions(-) 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..6343ed6d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ucap-webmessenger", - "version": "0.0.14", + "version": "0.0.13", "author": { "name": "LG CNS", "email": "lgucap@lgcns.com" 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 e59e270a..3fcf99a9 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 @@ -5,8 +5,10 @@
DS Talk
+ *ngIf="!!loginRes" + (search)="onIntegratedSearch($event)" + class="input-lineless integrated-search" + >
@@ -498,7 +501,7 @@
{{ playing ? 'pause' : 'play_arrow' }} diff --git a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/video-viewer.component.scss b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/video-viewer.component.scss index 0e1f1c55..9b060d85 100644 --- a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/video-viewer.component.scss +++ b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/video-viewer.component.scss @@ -13,7 +13,7 @@ } .ucap-video-viewer-title { - font-size:16px; + font-size: 16px; } .stroke-bar { width: 1px; @@ -35,11 +35,17 @@ .ucap-video-viewer-video-icon { width: 100%; - height: calc(100% - 80px); + height: calc(100% - 80px); + + .guide-msg { + font-size: 16px; + margin: 30px; + color: #ffffff; + } } - .viewer-bottom{ + .viewer-bottom { background-color: #212121; - color:#ffffff; + color: #ffffff; .ucap-video-viewer-video-time { width: 100%; height: 30px; @@ -62,11 +68,11 @@ flex: 1 1 auto; } .ucap-video-viewer-action { - .mat-icon{ + .mat-icon { font-size: 40px; width: 100%; height: 100%; - line-height:40px; + line-height: 40px; } } } @@ -75,9 +81,11 @@ mat-slider { width: 94%; } -::ng-deep .mat-slider-horizontal .mat-slider-track-background{ +::ng-deep .mat-slider-horizontal .mat-slider-track-background { background-color: #999999 !important; } -::ng-deep .mat-slider-min-value:not(.mat-slider-thumb-label-showing) .mat-slider-thumb{ +::ng-deep + .mat-slider-min-value:not(.mat-slider-thumb-label-showing) + .mat-slider-thumb { border-color: #999999 !important; -} \ No newline at end of file +} diff --git a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/video-viewer.component.ts b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/video-viewer.component.ts index a6c9c50c..38e9cd59 100644 --- a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/video-viewer.component.ts +++ b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/video-viewer.component.ts @@ -33,7 +33,7 @@ export class VideoViewerComponent implements OnInit { @Output() closed = new EventEmitter(); - @ViewChild('audioPlayer', { static: true }) + @ViewChild('audioPlayer', { static: false }) audioPlayer: ElementRef; @ViewChild('timeSlider', { static: true }) @@ -49,6 +49,8 @@ export class VideoViewerComponent implements OnInit { videoWidth = 0; videoHeight = 0; + playable = true; + Math = Math; constructor( @@ -101,6 +103,11 @@ export class VideoViewerComponent implements OnInit { this.videoWidth = this.audioPlayer.nativeElement.videoWidth; this.videoHeight = this.audioPlayer.nativeElement.videoHeight; + + if (0 === this.videoHeight || 0 === this.videoWidth) { + this.playable = false; + this.duration = 0; + } } onClickDownload(): void { From e307cdb3b6f3f38c65d8c3d6738641b27763161a Mon Sep 17 00:00:00 2001 From: richard-loafle <44828666+richard-loafle@users.noreply.github.com> Date: Wed, 5 Feb 2020 17:21:08 +0900 Subject: [PATCH 6/6] [ISSUE 113] fixed --- .../right-drawer/album-box.component.html | 13 ++++++++-- .../right-drawer/album-box.component.ts | 24 ++++++++++++++++++- 2 files changed, 34 insertions(+), 3 deletions(-) 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 }} +
  • {{ selectedFile.info.name }}
  • diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/album-box.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/album-box.component.ts index f5045111..e8fc9e0d 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/album-box.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/album-box.component.ts @@ -1,4 +1,11 @@ -import { Component, OnInit, OnDestroy, Inject } from '@angular/core'; +import { + Component, + OnInit, + OnDestroy, + Inject, + ElementRef, + ViewChild +} from '@angular/core'; import { FileInfo, FileDownloadInfo, @@ -45,6 +52,9 @@ export interface FileInfoTotal { styleUrls: ['./album-box.component.scss'] }) export class AlbumBoxComponent implements OnInit, OnDestroy { + @ViewChild('videoPlayer', { static: false }) + videoPlayer: ElementRef; + filteredList: FileInfoTotal[] = []; fileInfoTotal: FileInfoTotal[]; fileInfoList: FileInfo[]; @@ -62,6 +72,8 @@ export class AlbumBoxComponent implements OnInit, OnDestroy { thumbBaseUrl: string; + playable = true; + constructor( private store: Store, private sessionStorageService: SessionStorageService, @@ -186,6 +198,7 @@ export class AlbumBoxComponent implements OnInit, OnDestroy { event.stopPropagation(); } + this.playable = true; this.selectedFile = fileInfo; } @@ -323,4 +336,13 @@ export class AlbumBoxComponent implements OnInit, OnDestroy { this.logger.error(reason); }); } + + onLoadedDataVideo(): void { + if ( + 0 === this.videoPlayer.nativeElement.videoWidth || + 0 === this.videoPlayer.nativeElement.videoHeight + ) { + this.playable = false; + } + } }