[Statsig] Remove client downsampling (#6153)

This commit is contained in:
Hailey
2024-11-15 11:40:43 -08:00
committed by GitHub
parent 400c432283
commit 3bd1437133
13 changed files with 57 additions and 99 deletions
+3 -3
View File
@@ -15,7 +15,7 @@ const AnimatedPagerView = Animated.createAnimatedComponent(PagerView)
export interface PagerRef {
setPage: (
index: number,
reason: LogEvents['home:feedDisplayed:sampled']['reason'],
reason: LogEvents['home:feedDisplayed']['reason'],
) => void
}
@@ -32,7 +32,7 @@ interface Props {
onPageSelected?: (index: number) => void
onPageSelecting?: (
index: number,
reason: LogEvents['home:feedDisplayed:sampled']['reason'],
reason: LogEvents['home:feedDisplayed']['reason'],
) => void
onPageScrollStateChanged?: (
scrollState: 'idle' | 'dragging' | 'settling',
@@ -61,7 +61,7 @@ export const Pager = forwardRef<PagerRef, React.PropsWithChildren<Props>>(
React.useImperativeHandle(ref, () => ({
setPage: (
index: number,
reason: LogEvents['home:feedDisplayed:sampled']['reason'],
reason: LogEvents['home:feedDisplayed']['reason'],
) => {
pagerView.current?.setPage(index)
onPageSelecting?.(index, reason)
+3 -6
View File
@@ -18,7 +18,7 @@ interface Props {
onPageSelected?: (index: number) => void
onPageSelecting?: (
index: number,
reason: LogEvents['home:feedDisplayed:sampled']['reason'],
reason: LogEvents['home:feedDisplayed']['reason'],
) => void
}
export const Pager = React.forwardRef(function PagerImpl(
@@ -38,17 +38,14 @@ export const Pager = React.forwardRef(function PagerImpl(
React.useImperativeHandle(ref, () => ({
setPage: (
index: number,
reason: LogEvents['home:feedDisplayed:sampled']['reason'],
reason: LogEvents['home:feedDisplayed']['reason'],
) => {
onTabBarSelect(index, reason)
},
}))
const onTabBarSelect = React.useCallback(
(
index: number,
reason: LogEvents['home:feedDisplayed:sampled']['reason'],
) => {
(index: number, reason: LogEvents['home:feedDisplayed']['reason']) => {
const scrollY = window.scrollY
// We want to determine if the tabbar is already "sticking" at the top (in which
// case we should preserve and restore scroll), or if it is somewhere below in the