diff --git a/frontend/src/components/Activities.vue b/frontend/src/components/Activities.vue index a796afd9..964dc36c 100644 --- a/frontend/src/components/Activities.vue +++ b/frontend/src/components/Activities.vue @@ -958,7 +958,7 @@ const defaultActions = computed(() => { icon: h(PhoneIcon, { class: 'h-4 w-4' }), label: __('Make a Call'), onClick: () => makeCall(doc.value.data.mobile_no), - condition: () => Boolean(callEnabled.value), + condition: () => callEnabled.value, }, { icon: h(NoteIcon, { class: 'h-4 w-4' }), @@ -974,7 +974,7 @@ const defaultActions = computed(() => { icon: h(WhatsAppIcon, { class: 'h-4 w-4' }), label: __('New WhatsApp Message'), onClick: () => (tabIndex.value = 5), - condition: () => Boolean(whatsappEnabled.value), + condition: () => whatsappEnabled.value, }, ] return actions.filter((action) => diff --git a/frontend/src/pages/Deal.vue b/frontend/src/pages/Deal.vue index 59c9e201..3e010b00 100644 --- a/frontend/src/pages/Deal.vue +++ b/frontend/src/pages/Deal.vue @@ -452,7 +452,7 @@ const tabs = computed(() => { name: 'Calls', label: __('Calls'), icon: PhoneIcon, - condition: () => Boolean(callEnabled.value), + condition: () => callEnabled.value, }, { name: 'Tasks', @@ -468,7 +468,7 @@ const tabs = computed(() => { name: 'WhatsApp', label: __('WhatsApp'), icon: WhatsAppIcon, - condition: () => Boolean(whatsappEnabled.value), + condition: () => whatsappEnabled.value, }, ] return tabOptions.filter((tab) => (tab.condition ? tab.condition() : true)) diff --git a/frontend/src/pages/Lead.vue b/frontend/src/pages/Lead.vue index eb248be2..fe976a3d 100644 --- a/frontend/src/pages/Lead.vue +++ b/frontend/src/pages/Lead.vue @@ -417,7 +417,7 @@ const tabs = computed(() => { name: 'Calls', label: __('Calls'), icon: PhoneIcon, - condition: () => Boolean(callEnabled.value), + condition: () => callEnabled.value, }, { name: 'Tasks', @@ -433,8 +433,8 @@ const tabs = computed(() => { name: 'WhatsApp', label: __('WhatsApp'), icon: WhatsAppIcon, - condition: () => Boolean(whatsappEnabled.value), - } + condition: () => whatsappEnabled.value, + }, ] return tabOptions.filter((tab) => (tab.condition ? tab.condition() : true)) }) diff --git a/frontend/src/stores/settings.js b/frontend/src/stores/settings.js index fea5fbf4..534ade97 100644 --- a/frontend/src/stores/settings.js +++ b/frontend/src/stores/settings.js @@ -7,16 +7,15 @@ createResource({ cache: 'Is Whatsapp Enabled', auto: true, onSuccess: (data) => { - whatsappEnabled.value = 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 = data + callEnabled.value = Boolean(data) }, -}) \ No newline at end of file +})