fix: created global makeCall method instead of using provide/inject
This commit is contained in:
parent
b03401e75c
commit
6dfc2be68e
@ -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>
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user