[Statsig] Make gate checks lazily (#3594)
This commit is contained in:
parent
086dc93a7a
commit
02becdf449
14 changed files with 67 additions and 62 deletions
|
@ -40,8 +40,8 @@ function ListImpl<ItemT>(
|
|||
const isScrolledDown = useSharedValue(false)
|
||||
const contextScrollHandlers = useScrollHandlers()
|
||||
const pal = usePalette('default')
|
||||
const showsVerticalScrollIndicator =
|
||||
!useGate('hide_vertical_scroll_indicators') || isWeb
|
||||
const gate = useGate()
|
||||
|
||||
function handleScrolledDownChange(didScrollDown: boolean) {
|
||||
onScrolledDownChange?.(didScrollDown)
|
||||
}
|
||||
|
@ -97,7 +97,9 @@ function ListImpl<ItemT>(
|
|||
scrollEventThrottle={1}
|
||||
style={style}
|
||||
ref={ref}
|
||||
showsVerticalScrollIndicator={showsVerticalScrollIndicator}
|
||||
showsVerticalScrollIndicator={
|
||||
isWeb || !gate('hide_vertical_scroll_indicators')
|
||||
}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -10,14 +10,11 @@ export function CenteredView(props) {
|
|||
}
|
||||
|
||||
export function ScrollView(props) {
|
||||
const showsVerticalScrollIndicator = !useGate(
|
||||
'hide_vertical_scroll_indicators',
|
||||
)
|
||||
|
||||
const gate = useGate()
|
||||
return (
|
||||
<Animated.ScrollView
|
||||
{...props}
|
||||
showsVerticalScrollIndicator={showsVerticalScrollIndicator}
|
||||
showsVerticalScrollIndicator={!gate('hide_vertical_scroll_indicators')}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue