Skip to content

Commit 0e4e10c

Browse files
committed
🛂 (whatsapp) Remove feature flag
Closes #401
1 parent 1a4b8bb commit 0e4e10c

File tree

4 files changed

+18
-30
lines changed

4 files changed

+18
-30
lines changed

apps/builder/src/features/preview/components/RuntimeMenu.tsx

-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
Text,
1111
} from '@chakra-ui/react'
1212
import { runtimes } from '../data'
13-
import { isWhatsAppAvailable } from '@/features/telemetry/posthog'
1413

1514
type Runtime = (typeof runtimes)[number]
1615

@@ -37,9 +36,6 @@ export const RuntimeMenu = ({ selectedRuntime, onSelectRuntime }: Props) => {
3736
<MenuList w="100px">
3837
{runtimes
3938
.filter((runtime) => runtime.name !== selectedRuntime.name)
40-
.filter((runtime) =>
41-
runtime.name === 'WhatsApp' ? isWhatsAppAvailable() : true
42-
)
4339
.map((runtime) => (
4440
<MenuItem
4541
key={runtime.name}

apps/builder/src/features/publish/components/embeds/EmbedButton.tsx

+13-15
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import { NextjsModal } from './modals/Nextjs/NextjsModal'
4040
import { WhatsAppLogo } from '@/components/logos/WhatsAppLogo'
4141
import { WhatsAppModal } from './modals/WhatsAppModal/WhatsAppModal'
4242
import { ParentModalProvider } from '@/features/graph/providers/ParentModalProvider'
43-
import { isWhatsAppAvailable } from '@/features/telemetry/posthog'
4443
import { useWorkspace } from '@/features/workspace/WorkspaceProvider'
4544
import { hasProPerks } from '@/features/billing/helpers/hasProPerks'
4645
import { LockTag } from '@/features/billing/components/LockTag'
@@ -98,20 +97,19 @@ export const integrationsList = [
9897
(props: Pick<ModalProps, 'publicId' | 'isPublished'>) => {
9998
const { workspace } = useWorkspace()
10099

101-
if (isWhatsAppAvailable())
102-
return (
103-
<ParentModalProvider>
104-
<EmbedButton
105-
logo={<WhatsAppLogo height={100} width="70px" />}
106-
label="WhatsApp"
107-
lockTagPlan={hasProPerks(workspace) ? undefined : 'PRO'}
108-
modal={({ onClose, isOpen }) => (
109-
<WhatsAppModal isOpen={isOpen} onClose={onClose} {...props} />
110-
)}
111-
{...props}
112-
/>
113-
</ParentModalProvider>
114-
)
100+
return (
101+
<ParentModalProvider>
102+
<EmbedButton
103+
logo={<WhatsAppLogo height={100} width="70px" />}
104+
label="WhatsApp"
105+
lockTagPlan={hasProPerks(workspace) ? undefined : 'PRO'}
106+
modal={({ onClose, isOpen }) => (
107+
<WhatsAppModal isOpen={isOpen} onClose={onClose} {...props} />
108+
)}
109+
{...props}
110+
/>
111+
</ParentModalProvider>
112+
)
115113
},
116114
(props: Pick<ModalProps, 'publicId' | 'isPublished'>) => (
117115
<EmbedButton

apps/builder/src/features/publish/components/embeds/modals/WhatsAppModal/WhatsAppCredentialsModal.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -457,12 +457,15 @@ const Webhook = ({
457457
<Stack spacing={6}>
458458
<Text>
459459
In your{' '}
460-
<TextLink
460+
<Button
461+
as={Link}
461462
href={`https://developers.facebook.com/apps/${appId}/whatsapp-business/wa-settings`}
463+
rightIcon={<ExternalLinkIcon />}
462464
isExternal
465+
size="sm"
463466
>
464467
WhatsApp Settings page
465-
</TextLink>
468+
</Button>
466469
, click on the Edit button and insert the following values:
467470
</Text>
468471
<UnorderedList spacing={6}>

apps/builder/src/features/telemetry/posthog.tsx

-9
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,4 @@ export const identifyUser = (userId: string) => {
2424
posthog.identify(userId)
2525
}
2626

27-
export const isWhatsAppAvailable = () => {
28-
if (!env.NEXT_PUBLIC_POSTHOG_KEY || !posthog) return true
29-
const isWhatsAppEnabled = posthog.getFeatureFlag('whatsApp', {
30-
send_event: false,
31-
})
32-
if (isWhatsAppEnabled === undefined) return true
33-
return posthog.__loaded && isWhatsAppEnabled
34-
}
35-
3627
export { posthog }

0 commit comments

Comments
 (0)