@@ -10,7 +10,6 @@ import {
|
||||
Text,
|
||||
} from '@chakra-ui/react'
|
||||
import { runtimes } from '../data'
|
||||
import { isWhatsAppAvailable } from '@/features/telemetry/posthog'
|
||||
|
||||
type Runtime = (typeof runtimes)[number]
|
||||
|
||||
@@ -37,9 +36,6 @@ export const RuntimeMenu = ({ selectedRuntime, onSelectRuntime }: Props) => {
|
||||
<MenuList w="100px">
|
||||
{runtimes
|
||||
.filter((runtime) => runtime.name !== selectedRuntime.name)
|
||||
.filter((runtime) =>
|
||||
runtime.name === 'WhatsApp' ? isWhatsAppAvailable() : true
|
||||
)
|
||||
.map((runtime) => (
|
||||
<MenuItem
|
||||
key={runtime.name}
|
||||
|
||||
@@ -40,7 +40,6 @@ import { NextjsModal } from './modals/Nextjs/NextjsModal'
|
||||
import { WhatsAppLogo } from '@/components/logos/WhatsAppLogo'
|
||||
import { WhatsAppModal } from './modals/WhatsAppModal/WhatsAppModal'
|
||||
import { ParentModalProvider } from '@/features/graph/providers/ParentModalProvider'
|
||||
import { isWhatsAppAvailable } from '@/features/telemetry/posthog'
|
||||
import { useWorkspace } from '@/features/workspace/WorkspaceProvider'
|
||||
import { hasProPerks } from '@/features/billing/helpers/hasProPerks'
|
||||
import { LockTag } from '@/features/billing/components/LockTag'
|
||||
@@ -98,7 +97,6 @@ export const integrationsList = [
|
||||
(props: Pick<ModalProps, 'publicId' | 'isPublished'>) => {
|
||||
const { workspace } = useWorkspace()
|
||||
|
||||
if (isWhatsAppAvailable())
|
||||
return (
|
||||
<ParentModalProvider>
|
||||
<EmbedButton
|
||||
|
||||
@@ -457,12 +457,15 @@ const Webhook = ({
|
||||
<Stack spacing={6}>
|
||||
<Text>
|
||||
In your{' '}
|
||||
<TextLink
|
||||
<Button
|
||||
as={Link}
|
||||
href={`https://developers.facebook.com/apps/${appId}/whatsapp-business/wa-settings`}
|
||||
rightIcon={<ExternalLinkIcon />}
|
||||
isExternal
|
||||
size="sm"
|
||||
>
|
||||
WhatsApp Settings page
|
||||
</TextLink>
|
||||
</Button>
|
||||
, click on the Edit button and insert the following values:
|
||||
</Text>
|
||||
<UnorderedList spacing={6}>
|
||||
|
||||
@@ -24,13 +24,4 @@ export const identifyUser = (userId: string) => {
|
||||
posthog.identify(userId)
|
||||
}
|
||||
|
||||
export const isWhatsAppAvailable = () => {
|
||||
if (!env.NEXT_PUBLIC_POSTHOG_KEY || !posthog) return true
|
||||
const isWhatsAppEnabled = posthog.getFeatureFlag('whatsApp', {
|
||||
send_event: false,
|
||||
})
|
||||
if (isWhatsAppEnabled === undefined) return true
|
||||
return posthog.__loaded && isWhatsAppEnabled
|
||||
}
|
||||
|
||||
export { posthog }
|
||||
|
||||
Reference in New Issue
Block a user