This commit is contained in:
leejinho 2020-02-06 10:52:13 +09:00
commit 254bc2c05b
6 changed files with 26 additions and 7 deletions

View File

@ -9,7 +9,8 @@ import {
Inject, Inject,
ChangeDetectorRef, ChangeDetectorRef,
ChangeDetectionStrategy, ChangeDetectionStrategy,
ElementRef ElementRef,
NgZone
} from '@angular/core'; } from '@angular/core';
import { import {
ucapAnimations, ucapAnimations,
@ -248,6 +249,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
private dialogService: DialogService, private dialogService: DialogService,
private snackBarService: SnackBarService, private snackBarService: SnackBarService,
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService, @Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService,
private ngZone: NgZone,
private logger: NGXLogger private logger: NGXLogger
) { ) {
this.sessionVerInfo = this.sessionStorageService.get<VersionInfo2Response>( this.sessionVerInfo = this.sessionStorageService.get<VersionInfo2Response>(
@ -1080,19 +1082,30 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
.saveFile(buffer, value.fileInfo.fileName, mimeType, savePath) .saveFile(buffer, value.fileInfo.fileName, mimeType, savePath)
.then(result => { .then(result => {
if (!!result) { if (!!result) {
this.snackBarService.open( const snackBarRef = this.snackBarService.open(
this.translateService.instant( this.translateService.instant(
'common.file.results.savedToPath', 'common.file.results.savedToPath',
{ {
path: result path: result
} }
), ),
'', this.translateService.instant('common.file.open'),
{ {
duration: 3000, duration: 3000,
verticalPosition: 'bottom' verticalPosition: 'bottom',
horizontalPosition: 'center'
} }
); );
snackBarRef.onAction().subscribe(() => {
this.ngZone.runOutsideAngular(() => {
this.nativeService
.openTargetItem(result)
.catch(reason => {
this.logger.warn(reason);
});
});
});
} else { } else {
this.snackBarService.openFromComponent< this.snackBarService.openFromComponent<
AlertSnackbarComponent, AlertSnackbarComponent,

View File

@ -501,7 +501,7 @@
</span> </span>
<span class="version-info-button"> <span class="version-info-button">
<button <button
*ngIf="checkingUpdateIsExist"
mat-flat-button mat-flat-button
class="mat-primary" class="mat-primary"
(click)="onClickApplyUpdate($event)" (click)="onClickApplyUpdate($event)"

View File

@ -402,6 +402,7 @@
"save": "Save", "save": "Save",
"saveAs": "Save as", "saveAs": "Save as",
"saveAll": "Save all", "saveAll": "Save all",
"open": "Open",
"downloadSelected": "Download selected", "downloadSelected": "Download selected",
"openDownloadFolder": "Open download folder", "openDownloadFolder": "Open download folder",
"selectFiles": "Select files", "selectFiles": "Select files",

View File

@ -402,6 +402,7 @@
"save": "저장", "save": "저장",
"saveAs": "다른 이름으로 저장", "saveAs": "다른 이름으로 저장",
"saveAll": "파일 모두 저장", "saveAll": "파일 모두 저장",
"open": "열기",
"downloadSelected": "선택된 파일 다운로드", "downloadSelected": "선택된 파일 다운로드",
"openDownloadFolder": "다운로드 폴더 열기", "openDownloadFolder": "다운로드 폴더 열기",
"selectFiles": "파일을 선택하세요", "selectFiles": "파일을 선택하세요",

View File

@ -14,7 +14,7 @@
> >
<div #chatMessagesContainer class="chat-messages"> <div #chatMessagesContainer class="chat-messages">
<div <div
*ngIf="eventRemained && !!eventList && eventList.length > 0" *ngIf="initalized && eventRemained && !!eventList && eventList.length > 0"
class="message-row view-previous" class="message-row view-previous"
> >
<button mat-button (click)="onClickMore($event)" class="bg-accent-dark"> <button mat-button (click)="onClickMore($event)" class="bg-accent-dark">

View File

@ -155,6 +155,7 @@ export class MessagesComponent implements OnInit, OnDestroy {
existReadToHereEvent = true; existReadToHereEvent = true;
hidden = false; hidden = false;
swapped = false; swapped = false;
initalized = false;
constructor( constructor(
private logger: NGXLogger, private logger: NGXLogger,
@ -171,6 +172,7 @@ export class MessagesComponent implements OnInit, OnDestroy {
}); });
this.roomInfoSubscription = this.roomInfo$.subscribe(roomInfo => { this.roomInfoSubscription = this.roomInfo$.subscribe(roomInfo => {
this.roomInfo = roomInfo; this.roomInfo = roomInfo;
this.initalized = false;
/** [S] initializing by changed room */ /** [S] initializing by changed room */
// reset :: roomLastEventSeq // reset :: roomLastEventSeq
@ -532,7 +534,9 @@ export class MessagesComponent implements OnInit, OnDestroy {
this.swapScrollTo( this.swapScrollTo(
this.eventList[this.eventList.length - 1], this.eventList[this.eventList.length - 1],
() => {}, () => {},
() => {}, () => {
this.initalized = true;
},
-1 === this.virtualScroller.viewPortInfo.endIndex || -1 === this.virtualScroller.viewPortInfo.endIndex ||
!isInViewPortItems, !isInViewPortItems,
!isInViewPortItems !isInViewPortItems