From a67f14ce5e05ecd01fae0bb540832ca374a92df0 Mon Sep 17 00:00:00 2001 From: Abhinav Raut Date: Sat, 28 Mar 2026 18:15:35 +0530 Subject: [PATCH] Play notification sound only on messages from agents --- .../apps/main/src/features/admin/inbox/LivechatInboxForm.vue | 5 +++-- frontend/apps/widget/src/websocket.js | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/apps/main/src/features/admin/inbox/LivechatInboxForm.vue b/frontend/apps/main/src/features/admin/inbox/LivechatInboxForm.vue index bfd7946d..d383e4ac 100644 --- a/frontend/apps/main/src/features/admin/inbox/LivechatInboxForm.vue +++ b/frontend/apps/main/src/features/admin/inbox/LivechatInboxForm.vue @@ -992,10 +992,11 @@ const authenticatedIntegrationSnippet = computed(() => { // JavaScript API example const jsApiSnippet = computed(() => { + const inboxId = props.initialValues?.id || '' return `// Hide the default launcher and open programmatically initLibredeskWidget({ - baseURL: '...', - inboxID: 123, + baseURL: '${baseUrl.value}', + inboxID: ${inboxId}, hideDefaultLauncher: true }); diff --git a/frontend/apps/widget/src/websocket.js b/frontend/apps/widget/src/websocket.js index fe64a715..94c04777 100644 --- a/frontend/apps/widget/src/websocket.js +++ b/frontend/apps/widget/src/websocket.js @@ -94,10 +94,9 @@ export class WidgetWebSocketClient { const message = data.data chatStore.addMessageToConversation(message.conversation_uuid, message) - // Play notification sound if message is from agent and widget is not focused on this conversation + // Play notification sound if message is from agent and widget is not focused on this conversation. const widgetStore = useWidgetStore() - const userStore = useUserStore() - const isFromAgent = message.author?.id !== userStore.userID + const isFromAgent = message.author?.type === 'agent' const isViewingConversation = widgetStore.isOpen && widgetStore.isInChatView && chatStore.currentConversation?.uuid === message.conversation_uuid