about summary refs log tree commit diff
path: root/src/view/com/profile/ProfileHeader.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/com/profile/ProfileHeader.tsx')
-rw-r--r--src/view/com/profile/ProfileHeader.tsx9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/view/com/profile/ProfileHeader.tsx b/src/view/com/profile/ProfileHeader.tsx
index 46a6bb235..0ad6b2eb7 100644
--- a/src/view/com/profile/ProfileHeader.tsx
+++ b/src/view/com/profile/ProfileHeader.tsx
@@ -29,7 +29,7 @@ import {UserAvatar} from '../util/UserAvatar'
 import {UserBanner} from '../util/UserBanner'
 import {ProfileHeaderWarnings} from '../util/moderation/ProfileHeaderWarnings'
 import {usePalette} from 'lib/hooks/usePalette'
-import {useAnalytics} from 'lib/analytics'
+import {useAnalytics} from 'lib/analytics/analytics'
 import {NavigationProp} from 'lib/routes/types'
 import {listUriToHref} from 'lib/strings/url-helpers'
 import {isDesktopWeb, isNative} from 'platform/detection'
@@ -117,6 +117,11 @@ const ProfileHeaderLoaded = observer(
     }, [store, view])
 
     const onPressToggleFollow = React.useCallback(() => {
+      track(
+        view.viewer.following
+          ? 'ProfileHeader:FollowButtonClicked'
+          : 'ProfileHeader:UnfollowButtonClicked',
+      )
       view?.toggleFollowing().then(
         () => {
           Toast.show(
@@ -127,7 +132,7 @@ const ProfileHeaderLoaded = observer(
         },
         err => store.log.error('Failed to toggle follow', err),
       )
-    }, [view, store])
+    }, [track, view, store.log])
 
     const onPressEditProfile = React.useCallback(() => {
       track('ProfileHeader:EditProfileButtonClicked')