fix immutability errors

This commit is contained in:
Samuel Newman
2025-10-08 17:09:03 +03:00
parent 461f56a342
commit aac898d229
7 changed files with 36 additions and 29 deletions
+1 -1
View File
@@ -331,7 +331,7 @@ export function TabBar({
syncScrollState.set('unsynced')
}}
onScroll={e => {
scrollX.value = Math.round(e.nativeEvent.contentOffset.x)
scrollX.set(Math.round(e.nativeEvent.contentOffset.x))
}}>
<Animated.View
onLayout={e => {
+7 -4
View File
@@ -226,7 +226,8 @@ let PostFeed = ({
const initialNumToRender = useInitialNumToRender()
const feedFeedback = useFeedFeedbackContext()
const [isPTRing, setIsPTRing] = useState(false)
const lastFetchRef = useRef<number>(Date.now())
const [firstFetchTime] = useState(() => Date.now())
const lastFetchRef = useRef<number>(firstFetchTime)
const [feedType, feedUriOrActorDid, feedTab] = feed.split('|')
const {gtMobile} = useBreakpoints()
const {rightNavVisible} = useLayoutBreakpoints()
@@ -263,9 +264,11 @@ let PostFeed = ({
fetchNextPage,
} = usePostFeedQuery(feed, feedParams, opts)
const lastFetchedAt = data?.pages[0].fetchedAt
if (lastFetchedAt) {
lastFetchRef.current = lastFetchedAt
}
useEffect(() => {
if (lastFetchedAt) {
lastFetchRef.current = lastFetchedAt
}
}, [lastFetchedAt])
const isEmpty = useMemo(
() => !isFetching && !data?.pages?.some(page => page.slices.length),
[isFetching, data],
+5 -4
View File
@@ -103,6 +103,8 @@ export const FlatList_INTERNAL = React.forwardRef(function FlatListImpl<ItemT>(
paddingTop: Math.abs(contentOffset.y),
})
}
// @ts-expect-error web only
let dataSet = props.dataSet || {}
if (desktopFixedHeight) {
if (typeof desktopFixedHeight === 'number') {
// @ts-expect-error Web only -prf
@@ -121,10 +123,7 @@ export const FlatList_INTERNAL = React.forwardRef(function FlatListImpl<ItemT>(
// around this, we set data-stable-gutters which can then be
// styled in our external CSS.
// -prf
// @ts-expect-error web only -prf
props.dataSet = props.dataSet || {}
// @ts-expect-error web only -prf
props.dataSet.stableGutters = '1'
dataSet = {...dataSet, stableGutters: '1'}
}
}
return (
@@ -133,6 +132,8 @@ export const FlatList_INTERNAL = React.forwardRef(function FlatListImpl<ItemT>(
contentContainerStyle={[styles.contentContainer, contentContainerStyle]}
style={style}
contentOffset={contentOffset}
// @ts-expect-error web only
dataSet={dataSet}
{...props}
/>
)