fix(admin-ui): Create analytics if FF is enabled (#5367)
Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
This commit is contained in:
co-authored by
Philip Korsholm
parent
7d62176f74
commit
3b45fdf135
@@ -18,6 +18,7 @@ import AnalyticsConfigForm, {
|
|||||||
AnalyticsConfigFormType,
|
AnalyticsConfigFormType,
|
||||||
} from "../components/organisms/analytics-config-form"
|
} from "../components/organisms/analytics-config-form"
|
||||||
import { nestedForm } from "../utils/nested-form"
|
import { nestedForm } from "../utils/nested-form"
|
||||||
|
import { useFeatureFlag } from "../providers/feature-flag-provider"
|
||||||
|
|
||||||
type FormValues = {
|
type FormValues = {
|
||||||
password: string
|
password: string
|
||||||
@@ -69,6 +70,8 @@ const InvitePage = () => {
|
|||||||
setError,
|
setError,
|
||||||
} = form
|
} = form
|
||||||
|
|
||||||
|
const { isFeatureEnabled } = useFeatureFlag()
|
||||||
|
|
||||||
const { mutateAsync: acceptInvite, isLoading: acceptInviteIsLoading } =
|
const { mutateAsync: acceptInvite, isLoading: acceptInviteIsLoading } =
|
||||||
useAdminAcceptInvite()
|
useAdminAcceptInvite()
|
||||||
const {
|
const {
|
||||||
@@ -116,7 +119,9 @@ const InvitePage = () => {
|
|||||||
!data.analytics.opt_out &&
|
!data.analytics.opt_out &&
|
||||||
token?.user_email
|
token?.user_email
|
||||||
|
|
||||||
|
if (isFeatureEnabled("analytics")) {
|
||||||
await createAnalyticsConfig(data.analytics)
|
await createAnalyticsConfig(data.analytics)
|
||||||
|
}
|
||||||
|
|
||||||
if (shouldTrackEmail) {
|
if (shouldTrackEmail) {
|
||||||
trackUserEmail({
|
trackUserEmail({
|
||||||
|
|||||||
Reference in New Issue
Block a user