Skip to content

Commit

Permalink
Update - capture event when app is saved on the UI
Browse files Browse the repository at this point in the history
  • Loading branch information
aybruhm committed Dec 11, 2023
1 parent 61e98f6 commit 0a14b74
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {fetchEnvironments, publishVariant} from "@/lib/services/api"
import {Button, Checkbox, Modal, Space, Typography, message} from "antd"
import type {CheckboxChangeEvent} from "antd/es/checkbox"
import {useRouter} from "next/router"
import {usePostHog} from "posthog-js/react"
import React, {useEffect, useState} from "react"
import {createUseStyles} from "react-jss"

Expand Down Expand Up @@ -35,6 +36,7 @@ const PublishVariantModal: React.FC<Props> = ({
setSelectedEnvs([])
}
const router = useRouter()
const posthog = usePostHog()
const appId = router.query.app_id as string

const [selectedEnvs, setSelectedEnvs] = useState<string[]>([])
Expand All @@ -55,6 +57,7 @@ const PublishVariantModal: React.FC<Props> = ({
closeModal()
await loadEnvironments()
message.success(`Published ${variant.variantName} to ${envName}`)
posthog.capture('app_deployed', { app_id: appId, environment: envName })
})
}

Expand Down

0 comments on commit 0a14b74

Please sign in to comment.