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 CONTENT -->
<!-- CHAT FOOTER --> <!-- CHAT FOOTER -->
<div fxFlex="0 0 auto" fxLayout="column"> <div fxFlex="0 0 auto" fxLayout="column" *ngIf="getEnableSend()">
<!-- REPLY FORM --> <!-- REPLY FORM -->
<ucap-chat-form <ucap-chat-form
#chatForm #chatForm

View File

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