From 146e46d79f46768d53fb0faa49f46331e82ccfd9 Mon Sep 17 00:00:00 2001 From: Pranav Raj S Date: Fri, 17 Nov 2023 20:10:46 -0800 Subject: [PATCH] fix: Disable AI Assist CTA if not required (#8375) - Show CTAs only on production --- .../dashboard/components/widgets/AIAssistanceButton.vue | 4 +++- app/javascript/shared/store/globalConfig.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/javascript/dashboard/components/widgets/AIAssistanceButton.vue b/app/javascript/dashboard/components/widgets/AIAssistanceButton.vue index ab4047a1e..2d7951b05 100644 --- a/app/javascript/dashboard/components/widgets/AIAssistanceButton.vue +++ b/app/javascript/dashboard/components/widgets/AIAssistanceButton.vue @@ -61,6 +61,7 @@ export default { computed: { ...mapGetters({ currentChat: 'getSelectedChat', + isAChatwootInstance: 'globalConfig/isAChatwootInstance', }), isAICTAModalDismissed() { return this.uiSettings.is_open_ai_cta_modal_dismissed; @@ -70,7 +71,8 @@ export default { return ( this.isAdmin && !this.isAIIntegrationEnabled && - !this.isAICTAModalDismissed + !this.isAICTAModalDismissed && + this.isAChatwootInstance ); }, // Display a AI CTA button for agents and other admins who have not yet opened the AI assistance modal. diff --git a/app/javascript/shared/store/globalConfig.js b/app/javascript/shared/store/globalConfig.js index 60326dce5..5a266bd21 100644 --- a/app/javascript/shared/store/globalConfig.js +++ b/app/javascript/shared/store/globalConfig.js @@ -50,6 +50,7 @@ export const getters = { get: $state => $state, isOnChatwootCloud: $state => $state.deploymentEnv === 'cloud', isACustomBrandedInstance: $state => $state.installationName !== 'Chatwoot', + isAChatwootInstance: $state => $state.installationName === 'Chatwoot', }; export const actions = {};