2
0

fix(analytics): 🐛 No request if not published

This commit is contained in:
Baptiste Arnaud
2022-02-16 07:37:05 +01:00
parent ab9c55e297
commit 0bb50f9e78
2 changed files with 3 additions and 2 deletions

View File

@ -17,7 +17,7 @@ export const AnalyticsContent = ({ stats }: { stats?: Stats }) => {
status: 'error', status: 'error',
}) })
const { answersCounts } = useAnswersCount({ const { answersCounts } = useAnswersCount({
typebotId: typebot?.id, typebotId: publishedTypebot && typebot?.id,
onError: (err) => toast({ title: err.name, description: err.message }), onError: (err) => toast({ title: err.name, description: err.message }),
}) })
return ( return (

View File

@ -10,7 +10,7 @@ import {
useResults, useResults,
} from 'services/results' } from 'services/results'
import { unparse } from 'papaparse' import { unparse } from 'papaparse'
import { UnlockProPlanInfo } from 'components/shared/Info' import { PublishFirstInfo, UnlockProPlanInfo } from 'components/shared/Info'
type Props = { type Props = {
typebotId: string typebotId: string
@ -111,6 +111,7 @@ export const SubmissionsContent = ({
return ( return (
<Stack maxW="1200px" w="full" pb="28"> <Stack maxW="1200px" w="full" pb="28">
<PublishFirstInfo />
{totalHiddenResults && ( {totalHiddenResults && (
<UnlockProPlanInfo <UnlockProPlanInfo
buttonLabel={`Unlock ${totalHiddenResults} results`} buttonLabel={`Unlock ${totalHiddenResults} results`}