From 15b0569b56bf3c904fa5313d72c50f2b0f0a3da4 Mon Sep 17 00:00:00 2001 From: Yunus M Date: Thu, 29 Aug 2024 16:47:27 +0530 Subject: [PATCH] fix: show add credit card modal only for cloud users (#5797) --- frontend/src/container/AppLayout/index.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/src/container/AppLayout/index.tsx b/frontend/src/container/AppLayout/index.tsx index 3ee58efd7c..e821e67104 100644 --- a/frontend/src/container/AppLayout/index.tsx +++ b/frontend/src/container/AppLayout/index.tsx @@ -47,6 +47,7 @@ import { UPDATE_LATEST_VERSION_ERROR, } from 'types/actions/app'; import AppReducer from 'types/reducer/app'; +import { isCloudUser } from 'utils/app'; import { getFormattedDate, getRemainingDays } from 'utils/timeUtils'; import { ChildrenContainer, Layout, LayoutContent } from './styles'; @@ -71,7 +72,14 @@ function AppLayout(props: AppLayoutProps): JSX.Element { const isPremiumChatSupportEnabled = useFeatureFlags(FeatureKeys.PREMIUM_SUPPORT)?.active || false; + const isChatSupportEnabled = + useFeatureFlags(FeatureKeys.CHAT_SUPPORT)?.active || false; + + const isCloudUserVal = isCloudUser(); + const showAddCreditCardModal = + isChatSupportEnabled && + isCloudUserVal && !isPremiumChatSupportEnabled && !licenseData?.payload?.trialConvertedToSubscription;