Chat List: Fix jumping

This commit is contained in:
Alexander Zinchuk 2021-06-14 02:57:39 +03:00
parent 3f4901df28
commit 131ff8823e

View File

@ -70,6 +70,10 @@ export default (
return;
}
if (!noScroll) {
lastParamsRef.current = { ...lastParamsRef.current, direction, offsetId };
}
const {
newViewportIds, areSomeLocal, areAllLocal,
} = getViewportSlice(listIds, offsetId, direction, listSlice);
@ -80,10 +84,6 @@ export default (
}
if (!areAllLocal && loadMoreBackwards) {
if (!noScroll) {
lastParamsRef.current = { ...lastParamsRef.current, direction, offsetId };
}
loadMoreBackwards({ offsetId });
}
}, [listIds, listSlice, loadMoreBackwards, forceUpdate]);