crm/frontend/src/composables/settings.js
Pratik Badhe d985a44291 feat: add assignment rule
(cherry picked from commit 0c5684905f44af211189bf674735b046858a5b86)

# Conflicts:
#	frontend/components.d.ts
#	yarn.lock
2025-09-18 09:19:54 +00:00

48 lines
1.3 KiB
JavaScript

import { createResource } from 'frappe-ui'
import { computed, ref } from 'vue'
export const whatsappEnabled = ref(false)
export const isWhatsappInstalled = ref(false)
createResource({
url: 'crm.api.whatsapp.is_whatsapp_enabled',
cache: 'Is Whatsapp Enabled',
auto: true,
onSuccess: (data) => {
whatsappEnabled.value = Boolean(data)
},
})
createResource({
url: 'crm.api.whatsapp.is_whatsapp_installed',
cache: 'Is Whatsapp Installed',
auto: true,
onSuccess: (data) => {
isWhatsappInstalled.value = Boolean(data)
},
})
export const callEnabled = ref(false)
export const twilioEnabled = ref(false)
export const exotelEnabled = ref(false)
export const defaultCallingMedium = ref('')
createResource({
url: 'crm.integrations.api.is_call_integration_enabled',
cache: 'Is Call Integration Enabled',
auto: true,
onSuccess: (data) => {
twilioEnabled.value = Boolean(data.twilio_enabled)
exotelEnabled.value = Boolean(data.exotel_enabled)
defaultCallingMedium.value = data.default_calling_medium
callEnabled.value = twilioEnabled.value || exotelEnabled.value
},
})
export const mobileSidebarOpened = ref(false)
export const isMobileView = computed(() => window.innerWidth < 768)
export const showSettings = ref(false)
export const disableSettingModalOutsideClick = ref(false)
export const activeSettingsPage = ref('')