From 1150007d37138a289c7302ba2a11350be009435d Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 8 Apr 2024 17:20:58 +0100 Subject: [PATCH] Auto-expand follow suggestions on web (#3432) --- src/lib/statsig/statsig.tsx | 4 ++++ src/screens/Profile/Header/ProfileHeaderStandard.tsx | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/src/lib/statsig/statsig.tsx b/src/lib/statsig/statsig.tsx index 68c63de6..d0ef2408 100644 --- a/src/lib/statsig/statsig.tsx +++ b/src/lib/statsig/statsig.tsx @@ -78,6 +78,10 @@ function toStatsigUser(did: string | undefined) { return { userID, platform: Platform.OS, + custom: { + // Need to specify here too for gating. + platform: Platform.OS, + }, } } diff --git a/src/screens/Profile/Header/ProfileHeaderStandard.tsx b/src/screens/Profile/Header/ProfileHeaderStandard.tsx index 420b54f4..d6c6ff7b 100644 --- a/src/screens/Profile/Header/ProfileHeaderStandard.tsx +++ b/src/screens/Profile/Header/ProfileHeaderStandard.tsx @@ -10,7 +10,9 @@ import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' +import {useGate} from '#/lib/statsig/statsig' import {logger} from '#/logger' +import {isWeb} from '#/platform/detection' import {Shadow} from '#/state/cache/types' import {useModalControls} from '#/state/modals' import { @@ -78,6 +80,9 @@ let ProfileHeaderStandard = ({ }) }, [track, openModal, profile]) + const autoExpandSuggestionsOnProfileFollow = useGate( + 'autoexpand_suggestions_on_profile_follow', + ) const onPressFollow = () => { requireAuth(async () => { try { @@ -91,6 +96,9 @@ let ProfileHeaderStandard = ({ )}`, ), ) + if (isWeb && autoExpandSuggestionsOnProfileFollow) { + setShowSuggestedFollows(true) + } } catch (e: any) { if (e?.name !== 'AbortError') { logger.error('Failed to follow', {message: String(e)})