1
0
forked from test/crm

fix: created global makeCall method instead of using provide/inject

This commit is contained in:
Shariq Ansari 2023-09-20 14:10:29 +05:30
parent b03401e75c
commit 6dfc2be68e
3 changed files with 3 additions and 15 deletions

View File

@ -187,7 +187,7 @@ import { Device } from '@twilio/voice-sdk'
import { useDraggable, useWindowSize } from '@vueuse/core'
import { contactsStore } from '@/stores/contacts'
import { Avatar, call } from 'frappe-ui'
import { onMounted, provide, ref, watch } from 'vue'
import { onMounted, ref, watch, getCurrentInstance } from 'vue'
import NoteModal from './NoteModal.vue'
const { getContact } = contactsStore()
@ -292,15 +292,6 @@ function addDeviceListeners() {
})
}
// function update_call_log(conn, status = 'Completed') {
// console.log('connection', conn)
// if (!conn.parameters.CallSid) return
// call('crm.twilio.api.update_call_log', {
// call_sid: conn.parameters.CallSid,
// status: status,
// })
// }
function toggleMute() {
if (_call.value.isMuted()) {
_call.value.mute(false)
@ -492,7 +483,8 @@ watch(
{ immediate: true }
)
provide('makeOutgoingCall', makeOutgoingCall)
const app = getCurrentInstance()
app.appContext.config.globalProperties.makeCall = makeOutgoingCall
</script>
<style scoped>

View File

@ -394,8 +394,6 @@ import { ref, computed, inject } from 'vue'
const { getUser, users } = usersStore()
const { getContact, contacts } = contactsStore()
const makeCall = inject('makeOutgoingCall')
const props = defineProps({
dealId: {
type: String,

View File

@ -364,8 +364,6 @@ const { getUser, users } = usersStore()
const { getContact, contacts } = contactsStore()
const router = useRouter()
const makeCall = inject('makeOutgoingCall')
const props = defineProps({
leadId: {
type: String,