From 359c3c8ccb387450279485a27a1cd52e28302c96 Mon Sep 17 00:00:00 2001 From: Sanju Date: Tue, 27 Jul 2021 07:38:27 +0530 Subject: [PATCH] Fix: type error trim of undefined#2595 (#2702) --- .../components/widgets/conversation/ReplyBox.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue b/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue index 5d97076bb..9a2434fbf 100644 --- a/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue +++ b/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue @@ -169,7 +169,7 @@ export default { return this.maxLength - this.message.length; }, isReplyButtonDisabled() { - const isMessageEmpty = !this.message.trim().replace(/\n/g, '').length; + const isMessageEmpty = this.isMessageEmpty; if (this.hasAttachments) return false; return ( @@ -235,6 +235,12 @@ export default { isOnPrivateNote() { return this.replyType === REPLY_EDITOR_MODES.NOTE; }, + isMessageEmpty() { + if(!this.message) { + this.message = ''; + } + return !this.message.trim().replace(/\n/g, '').length; + }, }, watch: { currentChat(conversation) {