Add killswitch to getLikes request
This commit is contained in:
@@ -13,6 +13,7 @@ export enum Features {
|
|||||||
ComposerLanguageDetectionEnable = 'composer:language_detection:enable',
|
ComposerLanguageDetectionEnable = 'composer:language_detection:enable',
|
||||||
PostGalleryEmbedEnable = 'post_gallery_embed:enable',
|
PostGalleryEmbedEnable = 'post_gallery_embed:enable',
|
||||||
PostThreadKnownLikersEnable = 'post_thread:known_likers:enable',
|
PostThreadKnownLikersEnable = 'post_thread:known_likers:enable',
|
||||||
|
PostThreadKnownLikersFetchEnable = 'post_thread:known_likers:fetch:enable',
|
||||||
|
|
||||||
AATest = 'aa-test',
|
AATest = 'aa-test',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,8 +39,15 @@ export function LikesStat({post}: {post: AppBskyFeedDefs.PostView}) {
|
|||||||
const ax = useAnalytics()
|
const ax = useAnalytics()
|
||||||
|
|
||||||
const likeCount = post.likeCount ?? 0
|
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({
|
const {data} = useLikedBySampleQuery({
|
||||||
uri: hasSession && likeCount > 0 ? post.uri : undefined,
|
uri: fetchEnabled && hasSession && likeCount > 0 ? post.uri : undefined,
|
||||||
})
|
})
|
||||||
|
|
||||||
if (likeCount === 0) return null
|
if (likeCount === 0) return null
|
||||||
|
|||||||
Reference in New Issue
Block a user