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 { useDraggable, useWindowSize } from '@vueuse/core'
|
||||||
import { contactsStore } from '@/stores/contacts'
|
import { contactsStore } from '@/stores/contacts'
|
||||||
import { Avatar, call } from 'frappe-ui'
|
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'
|
import NoteModal from './NoteModal.vue'
|
||||||
|
|
||||||
const { getContact } = contactsStore()
|
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() {
|
function toggleMute() {
|
||||||
if (_call.value.isMuted()) {
|
if (_call.value.isMuted()) {
|
||||||
_call.value.mute(false)
|
_call.value.mute(false)
|
||||||
@ -492,7 +483,8 @@ watch(
|
|||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
)
|
)
|
||||||
|
|
||||||
provide('makeOutgoingCall', makeOutgoingCall)
|
const app = getCurrentInstance()
|
||||||
|
app.appContext.config.globalProperties.makeCall = makeOutgoingCall
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@ -394,8 +394,6 @@ import { ref, computed, inject } from 'vue'
|
|||||||
const { getUser, users } = usersStore()
|
const { getUser, users } = usersStore()
|
||||||
const { getContact, contacts } = contactsStore()
|
const { getContact, contacts } = contactsStore()
|
||||||
|
|
||||||
const makeCall = inject('makeOutgoingCall')
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
dealId: {
|
dealId: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|||||||
@ -364,8 +364,6 @@ const { getUser, users } = usersStore()
|
|||||||
const { getContact, contacts } = contactsStore()
|
const { getContact, contacts } = contactsStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
const makeCall = inject('makeOutgoingCall')
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
leadId: {
|
leadId: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user