1
0
forked from test/crm
jcrm/frontend/src/stores/global.js

31 lines
598 B
JavaScript

import { defineStore } from 'pinia'
import { getCurrentInstance, ref } from 'vue'
export const globalStore = defineStore('crm-global', () => {
const app = getCurrentInstance()
const { $dialog } = app.appContext.config.globalProperties
let twilioEnabled = ref(false)
let callMethod = () => {}
function setTwilioEnabled(value) {
twilioEnabled.value = value
}
function setMakeCall(value) {
callMethod = value
}
function makeCall(number) {
callMethod(number)
}
return {
$dialog,
twilioEnabled,
makeCall,
setTwilioEnabled,
setMakeCall,
}
})