Play notification sound only on messages from agents

This commit is contained in:
Abhinav Raut
2026-03-28 18:15:35 +05:30
parent b04d9d6f8d
commit a67f14ce5e
2 changed files with 5 additions and 5 deletions
@@ -992,10 +992,11 @@ const authenticatedIntegrationSnippet = computed(() => {
// JavaScript API example
const jsApiSnippet = computed(() => {
const inboxId = props.initialValues?.id || '<INBOX_ID>'
return `// Hide the default launcher and open programmatically
initLibredeskWidget({
baseURL: '...',
inboxID: 123,
baseURL: '${baseUrl.value}',
inboxID: ${inboxId},
hideDefaultLauncher: true
});
+2 -3
View File
@@ -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