crm/frontend/src/composables/settings.js
2024-06-04 16:11:48 +05:30

26 lines
642 B
JavaScript

import { createResource } from 'frappe-ui'
import { computed, ref } from 'vue'
export const whatsappEnabled = ref(false)
createResource({
url: 'crm.api.whatsapp.is_whatsapp_enabled',
cache: 'Is Whatsapp Enabled',
auto: true,
onSuccess: (data) => {
whatsappEnabled.value = Boolean(data)
},
})
export const callEnabled = ref(false)
createResource({
url: 'crm.integrations.twilio.api.is_enabled',
cache: 'Is Twilio Enabled',
auto: true,
onSuccess: (data) => {
callEnabled.value = Boolean(data)
},
})
export const mobileSidebarOpened = ref(false)
export const isMobileView = computed(() => window.innerWidth < 768)