mirror of
https://github.com/abhinavxd/libredesk.git
synced 2026-09-23 02:53:32 +00:00
Play notification sound only on messages from agents
This commit is contained in:
@@ -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
|
||||
});
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user