1
1
"use client" ;
2
2
3
3
import { 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" ;
4
7
import type { Project } from "@/api/projects" ;
5
8
import type { Team } from "@/api/team" ;
6
9
import { useDashboardRouter } from "@/lib/DashboardRouter" ;
@@ -12,7 +15,6 @@ import { toast } from "sonner";
12
15
import type { ThirdwebClient } from "thirdweb" ;
13
16
import { useActiveWallet , useDisconnect } from "thirdweb/react" ;
14
17
import { doLogout } from "../../../login/auth-actions" ;
15
-
16
18
import {
17
19
type TeamHeaderCompProps ,
18
20
TeamHeaderDesktopUI ,
@@ -27,6 +29,16 @@ export function TeamHeaderLoggedIn(props: {
27
29
accountAddress : string ;
28
30
client : ThirdwebClient ;
29
31
} ) {
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
+ } ) ;
30
42
const [ createProjectDialogState , setCreateProjectDialogState ] = useState <
31
43
{ team : Team ; isOpen : true } | { isOpen : false }
32
44
> ( { isOpen : false } ) ;
@@ -38,6 +50,7 @@ export function TeamHeaderLoggedIn(props: {
38
50
// log out the user
39
51
try {
40
52
await doLogout ( ) ;
53
+ resetAnalytics ( ) ;
41
54
if ( activeWallet ) {
42
55
disconnect ( activeWallet ) ;
43
56
}
0 commit comments