Skip to content

Commit

Permalink
🚸 Only show onboarding modal on cloud manage version
Browse files Browse the repository at this point in the history
Closes #173
  • Loading branch information
baptisteArno committed Jan 2, 2023
1 parent b9d3893 commit 080353b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/builder/src/components/SupportBubble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const SupportBubble = () => {

useEffect(() => {
if (
isCloudProdInstance() &&
isCloudProdInstance &&
(localTypebotId !== typebot?.id || localUserId !== user?.id)
) {
setLocalTypebotId(typebot?.id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const TypebotHeader = () => {
}

const handleHelpClick = () => {
isCloudProdInstance()
isCloudProdInstance
? getBubbleActions().open()
: window.open('https://docs.typebot.io', '_blank')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { CreateFolderButton } from './CreateFolderButton'
import { ButtonSkeleton, FolderButton } from './FolderButton'
import { TypebotButton } from './TypebotButton'
import { TypebotCardOverlay } from './TypebotButtonOverlay'
import { isCloudProdInstance } from '@/utils/helpers'

type Props = { folder: DashboardFolder | null }

Expand Down Expand Up @@ -162,6 +163,7 @@ export const FolderContent = ({ folder }: Props) => {
{typebots &&
!isTypebotLoading &&
user &&
isCloudProdInstance &&
folder === null &&
env('E2E_TEST') !== 'true' && (
<OnboardingModal totalTypebots={typebots.length} />
Expand Down
2 changes: 1 addition & 1 deletion apps/builder/src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const timeSince = (date: string) => {
return Math.floor(seconds) + 's'
}

export const isCloudProdInstance = () =>
export const isCloudProdInstance =
typeof window !== 'undefined' && window.location.hostname === 'app.typebot.io'

export const numberWithCommas = (x: number) =>
Expand Down

0 comments on commit 080353b

Please sign in to comment.