This commit is contained in:
병준 박 2019-11-06 18:19:51 +09:00
commit 958295a8c1
2 changed files with 31 additions and 5 deletions

View File

@ -124,7 +124,7 @@
<!-- / CHAT CONTENT -->
<!-- CHAT FOOTER -->
<div fxFlex="0 0 auto" fxLayout="column">
<div fxFlex="0 0 auto" fxLayout="column" *ngIf="getEnableSend()">
<!-- REPLY FORM -->
<ucap-chat-form
#chatForm

View File

@ -88,7 +88,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
@ViewChild('messageBoxContainer', { static: true })
private messageBoxContainer: ElementRef;
@ViewChild('chatForm', { static: true })
@ViewChild('chatForm', { static: false })
private chatForm: UCapUiChatFormComponent;
@ViewChild('messageContextMenuTrigger', { static: true })
@ -225,10 +225,18 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
return '대화방명을 가져오고 있습니다..';
}
switch (this.roomInfo.roomType) {
case RoomType.Mytalk:
return 'MyTalk';
case RoomType.Bot:
case RoomType.Allim:
return this.userInfoList
.filter(user => user.seq !== this.loginRes.userSeq)
.map(user => user.name);
}
if (!!this.roomInfo.roomName && '' !== this.roomInfo.roomName.trim()) {
return this.roomInfo.roomName;
} else if (this.roomInfo.roomType === RoomType.Mytalk) {
return 'MyTalk';
} else {
return this.userInfoList
.filter(user => {
@ -244,6 +252,22 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
}
}
getEnableSend() {
if (!this.roomInfo) {
return false;
}
if (
this.roomInfo.roomType === RoomType.Bot ||
this.roomInfo.roomType === RoomType.Allim ||
this.roomInfo.roomType === RoomType.Link
) {
return false;
}
return true;
}
getConvertTimer(timerInterval: number, unit: number = 1) {
if (timerInterval >= 0 && timerInterval < 60 * unit) {
return Math.floor((timerInterval / 1) * unit) + ' 초';
@ -267,7 +291,9 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
focusReplyInput(): void {
setTimeout(() => {
this.chatForm.focus();
if (!!this.chatForm) {
this.chatForm.focus();
}
});
}