mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 03:57:52 +00:00
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** <img width="223" alt="image" src="https://github.com/user-attachments/assets/bb4d7a34-4a1c-495a-9a3d-21d065bba020" /> **Deleted message bubble** <img width="223" alt="image" src="https://github.com/user-attachments/assets/ece8e2ff-c6d7-4fa7-b11c-04748bf9ea2d" /> ### After **Failed message bubble** <img width="223" alt="image" src="https://github.com/user-attachments/assets/6a6d81eb-52d9-48c3-bbc1-810b19770d61" /> **Deleted message bubble** <img width="223" alt="image" src="https://github.com/user-attachments/assets/828b553a-c88a-4a9e-9773-d75d76a9d0fd" /> ## 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
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user