From 332ab5888cdc2ead44f3f89e5d40fff15c8b96ea Mon Sep 17 00:00:00 2001 From: Vishnu Narayanan Date: Tue, 11 Jul 2023 00:58:55 +0530 Subject: [PATCH] feat: Disable fb/instagram if env variables are not configured (#7498) --- app/javascript/dashboard/components/widgets/ChannelItem.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/javascript/dashboard/components/widgets/ChannelItem.vue b/app/javascript/dashboard/components/widgets/ChannelItem.vue index 5ebee6b40..91cde46d5 100644 --- a/app/javascript/dashboard/components/widgets/ChannelItem.vue +++ b/app/javascript/dashboard/components/widgets/ChannelItem.vue @@ -21,6 +21,9 @@ export default { }, }, computed: { + hasFbConfigured() { + return window.chatwootConfig?.fbAppId; + }, isActive() { const { key } = this.channel; if (Object.keys(this.enabledFeatures).length === 0) { @@ -30,7 +33,7 @@ export default { return this.enabledFeatures.channel_website; } if (key === 'facebook') { - return this.enabledFeatures.channel_facebook; + return this.enabledFeatures.channel_facebook && this.hasFbConfigured; } if (key === 'twitter') { return this.enabledFeatures.channel_twitter;