From 9ebc2785e4dd51d2e8aa33d3d4365dede4280301 Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 29 Aug 2024 20:08:48 +0100 Subject: [PATCH] Remove logging of following prefs (#5021) --- src/lib/statsig/events.ts | 6 ------ src/view/screens/Home.tsx | 30 ++---------------------------- 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/src/lib/statsig/events.ts b/src/lib/statsig/events.ts index 7ef0c9e2..4768bdc2 100644 --- a/src/lib/statsig/events.ts +++ b/src/lib/statsig/events.ts @@ -216,12 +216,6 @@ export type LogEvents = { 'profile:header:suggestedFollowsCard:press': {} - 'debug:followingPrefs': { - followingShowRepliesFromPref: 'all' | 'following' | 'off' - followingRepliesMinLikePref: number - } - 'debug:followingDisplayed': {} - 'test:all:always': {} 'test:all:sometimes': {} 'test:all:boosted_by_gate1': {reason: 'base' | 'gate1'} diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx index 92599546..fb487ad6 100644 --- a/src/view/screens/Home.tsx +++ b/src/view/screens/Home.tsx @@ -10,7 +10,7 @@ import {logEvent, LogEvents} from '#/lib/statsig/statsig' import {useGate} from '#/lib/statsig/statsig' import {emitSoftReset} from '#/state/events' import {SavedFeedSourceInfo, usePinnedFeedsInfos} from '#/state/queries/feed' -import {FeedDescriptor, FeedParams} from '#/state/queries/post-feed' +import {FeedParams} from '#/state/queries/post-feed' import {usePreferencesQuery} from '#/state/queries/preferences' import {UsePreferencesQueryResponse} from '#/state/queries/preferences/types' import {useSession} from '#/state/session' @@ -108,30 +108,6 @@ function HomeScreenReady({ } }, [selectedIndex]) - // Temporary, remove when finished debugging - const debugHasLoggedFollowingPrefs = React.useRef(false) - const debugLogFollowingPrefs = React.useCallback( - (feed: FeedDescriptor) => { - if (debugHasLoggedFollowingPrefs.current) return - if (feed !== 'following') return - logEvent('debug:followingPrefs', { - followingShowRepliesFromPref: preferences.feedViewPrefs.hideReplies - ? 'off' - : preferences.feedViewPrefs.hideRepliesByUnfollowed - ? 'following' - : 'all', - followingRepliesMinLikePref: - preferences.feedViewPrefs.hideRepliesByLikeCount, - }) - debugHasLoggedFollowingPrefs.current = true - }, - [ - preferences.feedViewPrefs.hideReplies, - preferences.feedViewPrefs.hideRepliesByLikeCount, - preferences.feedViewPrefs.hideRepliesByUnfollowed, - ], - ) - const {hasSession} = useSession() const setMinimalShellMode = useSetMinimalShellMode() const setDrawerSwipeDisabled = useSetDrawerSwipeDisabled() @@ -154,7 +130,6 @@ function HomeScreenReady({ feedUrl: selectedFeed, reason: 'focus', }) - debugLogFollowingPrefs(selectedFeed) } }), ) @@ -205,9 +180,8 @@ function HomeScreenReady({ feedUrl: feed, reason, }) - debugLogFollowingPrefs(feed) }, - [allFeeds, debugLogFollowingPrefs], + [allFeeds], ) const onPressSelected = React.useCallback(() => {