diff --git a/src/analytics/features/types.ts b/src/analytics/features/types.ts index 283ef37088..b890873a37 100644 --- a/src/analytics/features/types.ts +++ b/src/analytics/features/types.ts @@ -13,6 +13,7 @@ export enum Features { ComposerLanguageDetectionEnable = 'composer:language_detection:enable', PostGalleryEmbedEnable = 'post_gallery_embed:enable', PostThreadKnownLikersEnable = 'post_thread:known_likers:enable', + PostThreadKnownLikersFetchEnable = 'post_thread:known_likers:fetch:enable', AATest = 'aa-test', } diff --git a/src/screens/PostThread/components/LikesStat.tsx b/src/screens/PostThread/components/LikesStat.tsx index 22e3fa4a32..4316b0b9b9 100644 --- a/src/screens/PostThread/components/LikesStat.tsx +++ b/src/screens/PostThread/components/LikesStat.tsx @@ -39,8 +39,15 @@ export function LikesStat({post}: {post: AppBskyFeedDefs.PostView}) { const ax = useAnalytics() const likeCount = post.likeCount ?? 0 + /* + * Kill switch for the getLikes sample request itself, separate from the + * display gate below. + */ + const fetchEnabled = ax.features.enabled( + ax.features.PostThreadKnownLikersFetchEnable, + ) const {data} = useLikedBySampleQuery({ - uri: hasSession && likeCount > 0 ? post.uri : undefined, + uri: fetchEnabled && hasSession && likeCount > 0 ? post.uri : undefined, }) if (likeCount === 0) return null