1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Better lookback update

This commit is contained in:
Zhiyuan Zheng
2022-01-30 22:51:03 +01:00
parent 45ba984ea3
commit bd49caa52a
13 changed files with 116 additions and 106 deletions

View File

@ -48,9 +48,6 @@ const Timeline: React.FC<Props> = ({
lookback,
customProps
}) => {
// Switching account update timeline
useSelector(getInstanceActive)
const { theme } = useTheme()
const {
@ -152,6 +149,13 @@ const Timeline: React.FC<Props> = ({
])
useScrollToTop(flRef)
useSelector(getInstanceActive, (prev, next) => {
if (prev !== next) {
flRef.current?.scrollToOffset({ offset: 0, animated: false })
}
return prev === next
})
return (
<>
<TimelineRefresh
@ -162,7 +166,6 @@ const Timeline: React.FC<Props> = ({
disableRefresh={disableRefresh}
/>
<AnimatedFlatList
// @ts-ignore
ref={customFLRef || flRef}
scrollEventThrottle={16}
onScroll={onScroll}