Add killswitch to getLikes request

This commit is contained in:
Alex Benzer
2026-07-10 17:28:00 -07:00
parent 88645b5111
commit e37e25ce59
2 changed files with 9 additions and 1 deletions
+1
View File
@@ -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',
}
@@ -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