From 6ff0c6750119d76049b5c0b8b49e37c8926aeb55 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 8 Apr 2026 21:26:47 +0530 Subject: [PATCH] fix: useInbox --- .../components-next/message/MessageMeta.vue | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/app/javascript/dashboard/components-next/message/MessageMeta.vue b/app/javascript/dashboard/components-next/message/MessageMeta.vue index f26339cbb..7a5a14fe7 100644 --- a/app/javascript/dashboard/components-next/message/MessageMeta.vue +++ b/app/javascript/dashboard/components-next/message/MessageMeta.vue @@ -9,6 +9,21 @@ import { useMessageContext } from './provider.js'; import { MESSAGE_STATUS, MESSAGE_TYPES } from './constants'; +const { + status, + isPrivate, + createdAt, + sourceId, + messageType, + contentAttributes, + inboxId, +} = useMessageContext(); + +// Resolve channel type from the message's own inbox so that the status +// indicator does not depend on `getSelectedChat` being populated. In the +// Agent SDK shell `setActiveChat` runs from a watcher in MessageList and can +// race with the first render of MessageMeta, leaving `currentChat` empty and +// every channel check returning false (the spinner stays forever). const { isAFacebookInbox, isALineChannel, @@ -21,16 +36,7 @@ const { isAnEmailChannel, isAnInstagramChannel, isATiktokChannel, -} = useInbox(); - -const { - status, - isPrivate, - createdAt, - sourceId, - messageType, - contentAttributes, -} = useMessageContext(); +} = useInbox(inboxId.value); const readableTime = computed(() => messageTimestamp(createdAt.value, 'LLL d, h:mm a')