From a1f61f0e21778c7d1954335ff19b820bfbdf36d5 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Mon, 14 Apr 2025 15:56:16 +0530 Subject: [PATCH] fix: Hide message status for failed and deleted messages (#11294) # Pull Request Template ## Description This PR fixes the issue where a clock with animation is shown inside the message bubble for failed and deleted messages. The message status is now hidden for such messages. ## Type of change Please delete options that are not relevant. - [x] Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? ### Before **Failed message bubble** image **Deleted message bubble** image ### After **Failed message bubble** image **Deleted message bubble** image ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [x] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules --- .../components-next/message/MessageMeta.vue | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/javascript/dashboard/components-next/message/MessageMeta.vue b/app/javascript/dashboard/components-next/message/MessageMeta.vue index d2ddd2c77..8d7c22dab 100644 --- a/app/javascript/dashboard/components-next/message/MessageMeta.vue +++ b/app/javascript/dashboard/components-next/message/MessageMeta.vue @@ -22,8 +22,14 @@ const { isAInstagramChannel, } = useInbox(); -const { status, isPrivate, createdAt, sourceId, messageType } = - useMessageContext(); +const { + status, + isPrivate, + createdAt, + sourceId, + messageType, + contentAttributes, +} = useMessageContext(); const readableTime = computed(() => messageTimestamp(createdAt.value, 'LLL d, h:mm a') @@ -31,6 +37,11 @@ const readableTime = computed(() => const showStatusIndicator = computed(() => { if (isPrivate.value) return false; + // Don't show status for failed messages, we already show error message + if (status.value === MESSAGE_STATUS.FAILED) return false; + // Don't show status for deleted messages + if (contentAttributes.value?.deleted) return false; + if (messageType.value === MESSAGE_TYPES.OUTGOING) return true; if (messageType.value === MESSAGE_TYPES.TEMPLATE) return true;