From 06b64b65b676096b77f3a0cba435b40f0bdf1cbd Mon Sep 17 00:00:00 2001 From: Hailey Date: Sun, 16 Jun 2024 01:12:13 -0700 Subject: [PATCH] add create/delete logs --- src/lib/statsig/events.ts | 7 +++++++ src/screens/StarterPack/Wizard/index.tsx | 10 +++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/lib/statsig/events.ts b/src/lib/statsig/events.ts index 81436b7d07..2e5d14d771 100644 --- a/src/lib/statsig/events.ts +++ b/src/lib/statsig/events.ts @@ -159,6 +159,13 @@ export type LogEvents = { starterPack: string followCount: number } + 'starterPack:delete': {} + 'starterPack:create': { + setName: boolean + setDescription: boolean + profilesCount: number + feedsCount: number + } 'test:all:always': {} 'test:all:sometimes': {} diff --git a/src/screens/StarterPack/Wizard/index.tsx b/src/screens/StarterPack/Wizard/index.tsx index 6b02d6dfc5..488e7eda6b 100644 --- a/src/screens/StarterPack/Wizard/index.tsx +++ b/src/screens/StarterPack/Wizard/index.tsx @@ -22,6 +22,7 @@ import {useQueryClient} from '@tanstack/react-query' import {HITSLOP_10} from 'lib/constants' import {createStarterPackList} from 'lib/generate-starterpack' import {CommonNavigatorParams, NavigationProp} from 'lib/routes/types' +import {logEvent} from 'lib/statsig/statsig' import {enforceLen} from 'lib/strings/helpers' import {isAndroid, isNative, isWeb} from 'platform/detection' import {invalidateActorStarterPacksQuery} from 'state/queries/actor-starter-packs' @@ -342,8 +343,14 @@ function WizardInner({ }, ) - const newRkey = new AtUri(res.uri).rkey + logEvent('starterPack:create', { + setName: state.name != null, + setDescription: state.description != null, + profilesCount: state.profiles.length, + feedsCount: state.feeds.length, + }) + const newRkey = new AtUri(res.uri).rkey setTimeout(() => { navigation.replace('StarterPack', { name: currentAccount!.handle, @@ -374,6 +381,7 @@ function WizardInner({ rkey, }) await invalidateQueries() + logEvent('starterPack:delete', {}) navigation.popToTop() } catch (e) { Toast.show(_(msg`Failed to delete starter pack`))