fix: Correct reversed message status indicators for API channel (#13594)
## Description Fixes the reversed message delivery status indicators for the API channel. The API inbox was grouped with the web widget inbox in the `isDelivered` computed property, causing both to treat a `sent` status as `delivered`. Since the API channel provides real `sent`/`delivered`/`read` status values from external systems (unlike the web widget which has no separate delivery confirmation), the API inbox needs its own handling. **Before this fix:** - Status `sent` (0) → incorrectly showed delivered checkmarks - Status `delivered` (1) → incorrectly showed "Sending" spinner **After this fix:** - Status `sent` → correctly shows sent indicator (single checkmark) - Status `delivered` → correctly shows delivered indicator (double checkmarks) - Status `read` → unchanged (already worked correctly) The web widget inbox behavior is unchanged — it still treats `sent` as `delivered` since it lacks a separate delivery confirmation mechanism. Fixes #13576 ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? Verified by code review that the computed properties now correctly map API channel message statuses: - `isSent` returns `true` when `status === 'sent'` for API inbox - `isDelivered` returns `true` when `status === 'delivered'` for API inbox - `isRead` unchanged — already checks `status === 'read'` for API inbox - Web widget inbox logic is unchanged ## 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 - [x] My changes generate no new warnings *This PR was created with the assistance of Claude Opus 4.6 by Anthropic. Happy to make any adjustments! Reviewed and submitted by a human.* Co-authored-by: Your Name <your-email@example.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -67,6 +67,9 @@ const isSent = computed(() => {
|
||||
return sourceId.value && status.value === MESSAGE_STATUS.SENT;
|
||||
}
|
||||
|
||||
// API inbox messages use real sent/delivered/read status values from the external system.
|
||||
if (isAPIInbox.value) return status.value === MESSAGE_STATUS.SENT;
|
||||
|
||||
// All messages will be mark as sent for the Line channel, as there is no source ID.
|
||||
if (isALineChannel.value) return true;
|
||||
|
||||
@@ -86,8 +89,10 @@ const isDelivered = computed(() => {
|
||||
) {
|
||||
return sourceId.value && status.value === MESSAGE_STATUS.DELIVERED;
|
||||
}
|
||||
// All messages marked as delivered for the web widget inbox and API inbox once they are sent.
|
||||
if (isAWebWidgetInbox.value || isAPIInbox.value) {
|
||||
// API inbox messages use real delivered status from the external system.
|
||||
if (isAPIInbox.value) return status.value === MESSAGE_STATUS.DELIVERED;
|
||||
// All messages marked as delivered for the web widget inbox once they are sent.
|
||||
if (isAWebWidgetInbox.value) {
|
||||
return status.value === MESSAGE_STATUS.SENT;
|
||||
}
|
||||
if (isALineChannel.value) {
|
||||
|
||||
Reference in New Issue
Block a user