Auto-expand follow suggestions on web (#3432)
parent
ed5647d434
commit
1150007d37
|
@ -78,6 +78,10 @@ function toStatsigUser(did: string | undefined) {
|
||||||
return {
|
return {
|
||||||
userID,
|
userID,
|
||||||
platform: Platform.OS,
|
platform: Platform.OS,
|
||||||
|
custom: {
|
||||||
|
// Need to specify here too for gating.
|
||||||
|
platform: Platform.OS,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,9 @@ import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
|
import {useGate} from '#/lib/statsig/statsig'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
|
import {isWeb} from '#/platform/detection'
|
||||||
import {Shadow} from '#/state/cache/types'
|
import {Shadow} from '#/state/cache/types'
|
||||||
import {useModalControls} from '#/state/modals'
|
import {useModalControls} from '#/state/modals'
|
||||||
import {
|
import {
|
||||||
|
@ -78,6 +80,9 @@ let ProfileHeaderStandard = ({
|
||||||
})
|
})
|
||||||
}, [track, openModal, profile])
|
}, [track, openModal, profile])
|
||||||
|
|
||||||
|
const autoExpandSuggestionsOnProfileFollow = useGate(
|
||||||
|
'autoexpand_suggestions_on_profile_follow',
|
||||||
|
)
|
||||||
const onPressFollow = () => {
|
const onPressFollow = () => {
|
||||||
requireAuth(async () => {
|
requireAuth(async () => {
|
||||||
try {
|
try {
|
||||||
|
@ -91,6 +96,9 @@ let ProfileHeaderStandard = ({
|
||||||
)}`,
|
)}`,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
if (isWeb && autoExpandSuggestionsOnProfileFollow) {
|
||||||
|
setShowSuggestedFollows(true)
|
||||||
|
}
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
if (e?.name !== 'AbortError') {
|
if (e?.name !== 'AbortError') {
|
||||||
logger.error('Failed to follow', {message: String(e)})
|
logger.error('Failed to follow', {message: String(e)})
|
||||||
|
|
Loading…
Reference in New Issue