this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Don't store scroll position while in loading state

+4 -2
+4 -2
src/pages/status.jsx
··· 38 38 // console.log('onScroll'); 39 39 if (!scrollableRef.current) return; 40 40 const { scrollTop } = scrollableRef.current; 41 - states.scrollPositions[id] = scrollTop; 41 + if (uiState !== 'loading') { 42 + states.scrollPositions[id] = scrollTop; 43 + } 42 44 }, 100); 43 45 scrollableRef.current.addEventListener('scroll', onScroll, { 44 46 passive: true, ··· 47 49 return () => { 48 50 scrollableRef.current?.removeEventListener('scroll', onScroll); 49 51 }; 50 - }, [id]); 52 + }, [id, uiState !== 'loading']); 51 53 52 54 const scrollOffsets = useRef(); 53 55 const cachedStatusesMap = useRef({});