Skip to content

Commit

Permalink
🎨 Format - ran prettier --write .
Browse files Browse the repository at this point in the history
  • Loading branch information
aybruhm committed Dec 11, 2023
1 parent 0a14b74 commit 0267787
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const ParametersView: React.FC<Props> = ({
onStateChange(false)
res(true)
})
posthog.capture('variant_saved', { variant_id: variant.variantId })
posthog.capture("variant_saved", {variant_id: variant.variantId})
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +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 })
posthog.capture("app_deployed", {app_id: appId, environment: envName})
})
}

Expand Down
13 changes: 7 additions & 6 deletions agenta-web/src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect } from 'react'
import {useEffect} from "react"
import type {AppProps} from "next/app"
import { useRouter } from 'next/router'
import {useRouter} from "next/router"

import posthog from "posthog-js"
import {PostHogProvider} from "posthog-js/react"
Expand All @@ -20,19 +20,20 @@ if (typeof window !== "undefined") {
if (process.env.NODE_ENV === "development") posthog.debug()
},
capture_pageview: false,
persistence: "localStorage+cookie"
persistence: "localStorage+cookie",
})
}

export default function App({Component, pageProps}: AppProps) {
const router = useRouter()

useEffect(() => {
const handleRouteChange = () => posthog.capture('$pageview', { $current_url: window.location.href })
router.events.on('routeChangeComplete', handleRouteChange)
const handleRouteChange = () =>
posthog.capture("$pageview", {$current_url: window.location.href})
router.events.on("routeChangeComplete", handleRouteChange)

return () => {
router.events.off('routeChangeComplete', handleRouteChange)
router.events.off("routeChangeComplete", handleRouteChange)
}
}, [])
return (
Expand Down

0 comments on commit 0267787

Please sign in to comment.