🚩(frontend) disable meeting rating when analytics is not configured
Hide the rating module in the feedback route when analytics service is unavailable to self host La Suite Meet without analytics.
This commit is contained in:
committed by
aleb_the_flash
parent
bc76c44fe9
commit
f2e6edb90d
@@ -6,6 +6,7 @@ import { styled, VStack } from '@/styled-system/jsx'
|
|||||||
import { usePostHog } from 'posthog-js/react'
|
import { usePostHog } from 'posthog-js/react'
|
||||||
import { PostHog } from 'posthog-js'
|
import { PostHog } from 'posthog-js'
|
||||||
import { Button as RACButton } from 'react-aria-components'
|
import { Button as RACButton } from 'react-aria-components'
|
||||||
|
import { useIsAnalyticsEnabled } from '@/features/analytics/hooks/useIsAnalyticsEnabled'
|
||||||
|
|
||||||
const Card = styled('div', {
|
const Card = styled('div', {
|
||||||
base: {
|
base: {
|
||||||
@@ -299,6 +300,7 @@ const AuthenticationMessage = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const Rating = () => {
|
export const Rating = () => {
|
||||||
|
const isAnalyticsEnabled = useIsAnalyticsEnabled()
|
||||||
const posthog = usePostHog()
|
const posthog = usePostHog()
|
||||||
|
|
||||||
const isUserAnonymous = useMemo(() => {
|
const isUserAnonymous = useMemo(() => {
|
||||||
@@ -307,6 +309,8 @@ export const Rating = () => {
|
|||||||
|
|
||||||
const [step, setStep] = useState(0)
|
const [step, setStep] = useState(0)
|
||||||
|
|
||||||
|
if (!isAnalyticsEnabled) return
|
||||||
|
|
||||||
if (step == 0) {
|
if (step == 0) {
|
||||||
return <RateQuality posthog={posthog} onNext={() => setStep(step + 1)} />
|
return <RateQuality posthog={posthog} onNext={() => setStep(step + 1)} />
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user