about summary refs log tree commit diff
path: root/src/state
diff options
context:
space:
mode:
Diffstat (limited to 'src/state')
-rw-r--r--src/state/queries/post.ts16
-rw-r--r--src/state/queries/preferences/index.ts3
-rw-r--r--src/state/queries/profile.ts5
-rw-r--r--src/state/session/index.tsx4
-rw-r--r--src/state/shell/onboarding.tsx4
5 files changed, 1 insertions, 31 deletions
diff --git a/src/state/queries/post.ts b/src/state/queries/post.ts
index 982d224ae..7023580bb 100644
--- a/src/state/queries/post.ts
+++ b/src/state/queries/post.ts
@@ -2,7 +2,6 @@ import {useCallback} from 'react'
 import {AppBskyActorDefs, AppBskyFeedDefs, AtUri} from '@atproto/api'
 import {useMutation, useQuery, useQueryClient} from '@tanstack/react-query'
 
-import {track} from '#/lib/analytics/analytics'
 import {useToggleMutationQueue} from '#/lib/hooks/useToggleMutationQueue'
 import {logEvent, LogEvents, toClout} from '#/lib/statsig/statsig'
 import {updatePostShadow} from '#/state/cache/post-shadow'
@@ -193,9 +192,6 @@ function usePostLikeMutation(
       })
       return agent.like(uri, cid)
     },
-    onSuccess() {
-      track('Post:Like')
-    },
   })
 }
 
@@ -208,9 +204,6 @@ function usePostUnlikeMutation(
       logEvent('post:unlike:sampled', {logContext})
       return agent.deleteLike(likeUri)
     },
-    onSuccess() {
-      track('Post:Unlike')
-    },
   })
 }
 
@@ -285,9 +278,6 @@ function usePostRepostMutation(
       logEvent('post:repost:sampled', {logContext})
       return agent.repost(post.uri, post.cid)
     },
-    onSuccess() {
-      track('Post:Repost')
-    },
   })
 }
 
@@ -300,9 +290,6 @@ function usePostUnrepostMutation(
       logEvent('post:unrepost:sampled', {logContext})
       return agent.deleteRepost(repostUri)
     },
-    onSuccess() {
-      track('Post:Unrepost')
-    },
   })
 }
 
@@ -313,9 +300,8 @@ export function usePostDeleteMutation() {
     mutationFn: async ({uri}) => {
       await agent.deletePost(uri)
     },
-    onSuccess(data, variables) {
+    onSuccess(_, variables) {
       updatePostShadow(queryClient, variables.uri, {isDeleted: true})
-      track('Post:Delete')
     },
   })
 }
diff --git a/src/state/queries/preferences/index.ts b/src/state/queries/preferences/index.ts
index ab866d5e2..3cb121a47 100644
--- a/src/state/queries/preferences/index.ts
+++ b/src/state/queries/preferences/index.ts
@@ -5,7 +5,6 @@ import {
 } from '@atproto/api'
 import {useMutation, useQuery, useQueryClient} from '@tanstack/react-query'
 
-import {track} from '#/lib/analytics/analytics'
 import {PROD_DEFAULT_FEED} from '#/lib/constants'
 import {replaceEqualDeep} from '#/lib/functions'
 import {getAge} from '#/lib/strings/time'
@@ -218,7 +217,6 @@ export function useAddSavedFeedsMutation() {
   >({
     mutationFn: async savedFeeds => {
       await agent.addSavedFeeds(savedFeeds)
-      track('CustomFeed:Save')
       // triggers a refetch
       await queryClient.invalidateQueries({
         queryKey: preferencesQueryKey,
@@ -234,7 +232,6 @@ export function useRemoveFeedMutation() {
   return useMutation<void, unknown, Pick<AppBskyActorDefs.SavedFeed, 'id'>>({
     mutationFn: async savedFeed => {
       await agent.removeSavedFeeds([savedFeed.id])
-      track('CustomFeed:Unsave')
       // triggers a refetch
       await queryClient.invalidateQueries({
         queryKey: preferencesQueryKey,
diff --git a/src/state/queries/profile.ts b/src/state/queries/profile.ts
index 532b005cf..78a142eea 100644
--- a/src/state/queries/profile.ts
+++ b/src/state/queries/profile.ts
@@ -16,7 +16,6 @@ import {
   useQueryClient,
 } from '@tanstack/react-query'
 
-import {track} from '#/lib/analytics/analytics'
 import {uploadBlob} from '#/lib/api'
 import {until} from '#/lib/async/until'
 import {useToggleMutationQueue} from '#/lib/hooks/useToggleMutationQueue'
@@ -316,9 +315,6 @@ function useProfileFollowMutation(
       })
       return await agent.follow(did)
     },
-    onSuccess(data, variables) {
-      track('Profile:Follow', {username: variables.did})
-    },
   })
 }
 
@@ -329,7 +325,6 @@ function useProfileUnfollowMutation(
   return useMutation<void, Error, {did: string; followUri: string}>({
     mutationFn: async ({followUri}) => {
       logEvent('profile:unfollow:sampled', {logContext})
-      track('Profile:Unfollow', {username: followUri})
       return await agent.deleteFollow(followUri)
     },
   })
diff --git a/src/state/session/index.tsx b/src/state/session/index.tsx
index 21fe7f75b..ab3352bf3 100644
--- a/src/state/session/index.tsx
+++ b/src/state/session/index.tsx
@@ -1,7 +1,6 @@
 import React from 'react'
 import {AtpSessionEvent, BskyAgent} from '@atproto/api'
 
-import {track} from '#/lib/analytics/analytics'
 import {logEvent} from '#/lib/statsig/statsig'
 import {isWeb} from '#/platform/detection'
 import * as persisted from '#/state/persisted'
@@ -70,7 +69,6 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
     async params => {
       addSessionDebugLog({type: 'method:start', method: 'createAccount'})
       const signal = cancelPendingTask()
-      track('Try Create Account')
       logEvent('account:create:begin', {})
       const {agent, account} = await createAgentAndCreateAccount(
         params,
@@ -85,7 +83,6 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
         newAgent: agent,
         newAccount: account,
       })
-      track('Create Account')
       logEvent('account:create:success', {})
       addSessionDebugLog({type: 'method:end', method: 'createAccount', account})
     },
@@ -109,7 +106,6 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
         newAgent: agent,
         newAccount: account,
       })
-      track('Sign In', {resumedSession: false})
       logEvent('account:loggedIn', {logContext, withPassword: true})
       addSessionDebugLog({type: 'method:end', method: 'login', account})
     },
diff --git a/src/state/shell/onboarding.tsx b/src/state/shell/onboarding.tsx
index d3a8fec46..9aad9953d 100644
--- a/src/state/shell/onboarding.tsx
+++ b/src/state/shell/onboarding.tsx
@@ -1,6 +1,5 @@
 import React from 'react'
 
-import {track} from '#/lib/analytics/analytics'
 import * as persisted from '#/state/persisted'
 
 export const OnboardingScreenSteps = {
@@ -55,17 +54,14 @@ function reducer(state: StateContext, action: Action): StateContext {
       return compute({...state, step: nextStep})
     }
     case 'start': {
-      track('Onboarding:Begin')
       persisted.write('onboarding', {step: 'Welcome'})
       return compute({...state, step: 'Welcome'})
     }
     case 'finish': {
-      track('Onboarding:Complete')
       persisted.write('onboarding', {step: 'Home'})
       return compute({...state, step: 'Home'})
     }
     case 'skip': {
-      track('Onboarding:Skipped')
       persisted.write('onboarding', {step: 'Home'})
       return compute({...state, step: 'Home'})
     }