11"use client" ;
22
33import { createTeam } from "@/actions/createTeam" ;
4+ import { useIdentifyAccount } from "@/analytics/hooks/identify-account" ;
5+ import { useIdentifyTeam } from "@/analytics/hooks/identify-team" ;
6+ import { resetAnalytics } from "@/analytics/reset" ;
47import type { Project } from "@/api/projects" ;
58import type { Team } from "@/api/team" ;
69import { useDashboardRouter } from "@/lib/DashboardRouter" ;
@@ -12,7 +15,6 @@ import { toast } from "sonner";
1215import type { ThirdwebClient } from "thirdweb" ;
1316import { useActiveWallet , useDisconnect } from "thirdweb/react" ;
1417import { doLogout } from "../../../login/auth-actions" ;
15-
1618import {
1719 type TeamHeaderCompProps ,
1820 TeamHeaderDesktopUI ,
@@ -27,6 +29,16 @@ export function TeamHeaderLoggedIn(props: {
2729 accountAddress : string ;
2830 client : ThirdwebClient ;
2931} ) {
32+ // identify the account
33+ useIdentifyAccount ( {
34+ accountId : props . account . id ,
35+ email : props . account . email ,
36+ } ) ;
37+
38+ // identify the team
39+ useIdentifyTeam ( {
40+ teamId : props . currentTeam . id ,
41+ } ) ;
3042 const [ createProjectDialogState , setCreateProjectDialogState ] = useState <
3143 { team : Team ; isOpen : true } | { isOpen : false }
3244 > ( { isOpen : false } ) ;
@@ -38,6 +50,7 @@ export function TeamHeaderLoggedIn(props: {
3850 // log out the user
3951 try {
4052 await doLogout ( ) ;
53+ resetAnalytics ( ) ;
4154 if ( activeWallet ) {
4255 disconnect ( activeWallet ) ;
4356 }
0 commit comments