fix: capture whatsapp events

This commit is contained in:
Shariq Ansari 2024-08-16 19:11:21 +05:30
parent 7bbe62de15
commit 4159bb6196
2 changed files with 6 additions and 2 deletions

View File

@ -170,9 +170,9 @@ import DoubleCheckIcon from '@/components/Icons/DoubleCheckIcon.vue'
import DocumentIcon from '@/components/Icons/DocumentIcon.vue'
import ReactIcon from '@/components/Icons/ReactIcon.vue'
import { dateFormat } from '@/utils'
import { capture } from '@/telemetry'
import { Tooltip, Dropdown, createResource } from 'frappe-ui'
import { ref } from 'vue'
import FeatherIcon from 'frappe-ui/src/components/FeatherIcon.vue'
const props = defineProps({
messages: Array,
@ -219,6 +219,7 @@ function reactOnMessage(name, emoji) {
},
auto: true,
onSuccess() {
capture('whatsapp_react_on_message')
list.value.reload()
},
})

View File

@ -39,6 +39,7 @@
() => {
content += emoji
$refs.textarea.$el.focus()
capture('whatsapp_emoji_added')
}
"
>
@ -65,8 +66,8 @@
<script setup>
import IconPicker from '@/components/IconPicker.vue'
import SmileIcon from '@/components/Icons/SmileIcon.vue'
import { capture } from '@/telemetry'
import { createResource, Textarea, FileUploader, Dropdown } from 'frappe-ui'
import FeatherIcon from 'frappe-ui/src/components/FeatherIcon.vue'
import { ref, nextTick, watch } from 'vue'
const props = defineProps({
@ -92,6 +93,7 @@ function uploadFile(file) {
whatsapp.value.attach = file.file_url
whatsapp.value.content_type = fileType.value
sendWhatsAppMessage()
capture('whatsapp_upload_file')
}
function sendTextMessage(event) {
@ -99,6 +101,7 @@ function sendTextMessage(event) {
sendWhatsAppMessage()
textarea.value.$el.blur()
content.value = ''
capture('whatsapp_send_message')
}
async function sendWhatsAppMessage() {