From 12c338364e7d8e40ca64419b7bf9251935104347 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 26 Jul 2023 23:37:37 +0530 Subject: [PATCH] fix: sentry issues [CW-2222][CW-2232] (#7591) --- .../search/components/MessageContent.vue | 17 ++++++++++++----- .../conversation/contact/ConversationForm.vue | 4 +++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/app/javascript/dashboard/modules/search/components/MessageContent.vue b/app/javascript/dashboard/modules/search/components/MessageContent.vue index bf0bb18ea..bd09c2a37 100644 --- a/app/javascript/dashboard/modules/search/components/MessageContent.vue +++ b/app/javascript/dashboard/modules/search/components/MessageContent.vue @@ -49,13 +49,20 @@ export default { }, }, mounted() { - this.$nextTick(() => { - const wrap = this.$refs.messageContainer; - const message = wrap.querySelector('.message-content'); - this.isOverflowing = message.offsetHeight > 150; - }); + this.$watch(() => { + return this.$refs.messageContainer; + }, this.setOverflow); + + this.$nextTick(this.setOverflow); }, methods: { + setOverflow() { + const wrap = this.$refs.messageContainer; + if (wrap) { + const message = wrap.querySelector('.message-content'); + this.isOverflowing = message.offsetHeight > 150; + } + }, escapeHtml(html) { var text = document.createTextNode(html); var p = document.createElement('p'); diff --git a/app/javascript/dashboard/routes/dashboard/conversation/contact/ConversationForm.vue b/app/javascript/dashboard/routes/dashboard/conversation/contact/ConversationForm.vue index 496efe505..9264f7afe 100644 --- a/app/javascript/dashboard/routes/dashboard/conversation/contact/ConversationForm.vue +++ b/app/javascript/dashboard/routes/dashboard/conversation/contact/ConversationForm.vue @@ -242,7 +242,9 @@ export default { get() { const inboxList = this.contact.contactableInboxes || []; return ( - inboxList.find(inbox => inbox.inbox.id === this.targetInbox.id) || { + inboxList.find(inbox => { + return inbox.inbox?.id && inbox.inbox?.id === this.targetInbox?.id; + }) || { inbox: {}, } );