diff --git a/apps/builder/src/components/NewVersionPopup.tsx b/apps/builder/src/components/NewVersionPopup.tsx
index 6258bd003..d6862a758 100644
--- a/apps/builder/src/components/NewVersionPopup.tsx
+++ b/apps/builder/src/components/NewVersionPopup.tsx
@@ -1,5 +1,13 @@
import { useTypebot } from '@/features/editor'
-import { Button, Flex, HStack, Stack, Text } from '@chakra-ui/react'
+import {
+ Button,
+ DarkMode,
+ Flex,
+ HStack,
+ SlideFade,
+ Stack,
+ Text,
+} from '@chakra-ui/react'
import { useEffect, useState } from 'react'
import { sendRequest } from 'utils'
import { PackageIcon } from './icons'
@@ -42,43 +50,51 @@ export const NewVersionPopup = () => {
window.location.reload()
}
- if (!isNewVersionAvailable) return null
-
return (
-
-
-
-
-
- {' '}
- New version available!
-
+
+
+
+
+
+
+
+ {' '}
+ New version available!
+
-
- An improved version of Typebot is available. Please reload now to
- upgrade.
-
-
-
-
-
+
+ An improved version of Typebot is available. Please reload now
+ to upgrade.
+
+
+
+
+
+
+
-
-
+
+
)
}
diff --git a/apps/builder/src/features/editor/providers/TypebotProvider/TypebotProvider.tsx b/apps/builder/src/features/editor/providers/TypebotProvider/TypebotProvider.tsx
index 15518df36..0fc75648e 100644
--- a/apps/builder/src/features/editor/providers/TypebotProvider/TypebotProvider.tsx
+++ b/apps/builder/src/features/editor/providers/TypebotProvider/TypebotProvider.tsx
@@ -102,7 +102,7 @@ export const TypebotProvider = ({
typebotId,
}: {
children: ReactNode
- typebotId: string
+ typebotId?: string
}) => {
const { status } = useSession()
const { push } = useRouter()
diff --git a/apps/builder/src/hooks/useTypebotQuery.ts b/apps/builder/src/hooks/useTypebotQuery.ts
index d94c26c32..28b307215 100644
--- a/apps/builder/src/hooks/useTypebotQuery.ts
+++ b/apps/builder/src/hooks/useTypebotQuery.ts
@@ -7,7 +7,7 @@ export const useTypebotQuery = ({
typebotId,
onError,
}: {
- typebotId: string
+ typebotId?: string
onError?: (error: Error) => void
}) => {
const { data, error, mutate } = useSWR<
@@ -18,7 +18,7 @@ export const useTypebotQuery = ({
isReadOnly?: boolean
},
Error
- >(`/api/typebots/${typebotId}`, fetcher, {
+ >(typebotId ? `/api/typebots/${typebotId}` : null, fetcher, {
dedupingInterval: env('E2E_TEST') === 'true' ? 0 : undefined,
})
if (error && onError) onError(error)
diff --git a/apps/builder/src/pages/_app.tsx b/apps/builder/src/pages/_app.tsx
index b9e403634..74f273448 100644
--- a/apps/builder/src/pages/_app.tsx
+++ b/apps/builder/src/pages/_app.tsx
@@ -26,7 +26,7 @@ const App = ({
pageProps: { session, ...pageProps },
}: AppProps<{ session?: Session }>) => {
useRouterProgressBar()
- const { query, pathname, isReady } = useRouter()
+ const { query, pathname } = useRouter()
useEffect(() => {
pathname.endsWith('/edit')
@@ -38,13 +38,12 @@ const App = ({
const newPlan = query.stripe?.toString()
if (newPlan === Plan.STARTER || newPlan === Plan.PRO)
toast({
- position: 'bottom-right',
+ position: 'top-right',
status: 'success',
title: 'Upgrade success!',
description: `Workspace upgraded to ${toTitleCase(newPlan)} 🎉`,
})
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [isReady])
+ }, [query.stripe])
const typebotId = query.typebotId?.toString()
@@ -54,21 +53,13 @@ const App = ({
- {typebotId ? (
-
-
-
-
-
-
-
- ) : (
-
+
+
- )}
+