diff --git a/src/components/Views/Expo/Expo.tsx b/src/components/Views/Expo/Expo.tsx index 06c592e2..1d347b82 100644 --- a/src/components/Views/Expo/Expo.tsx +++ b/src/components/Views/Expo/Expo.tsx @@ -58,7 +58,6 @@ export const Expo = (props: Props) => { } const loadMore = async (count: number) => { - saveScrollPosition() const options: LoadShoutsOptions = { filters: getLoadShoutsFilters(), limit: count, @@ -67,6 +66,11 @@ export const Expo = (props: Props) => { const { hasMore } = await loadShouts(options) setIsLoadMoreButtonVisible(hasMore) + } + + const loadMoreWithoutScrolling = async (count: number) => { + saveScrollPosition() + await loadMore(count) restoreScrollPosition() } @@ -137,7 +141,7 @@ export const Expo = (props: Props) => { }) const handleLoadMoreClick = () => { - loadMore(LOAD_MORE_PAGE_SIZE) + loadMoreWithoutScrolling(LOAD_MORE_PAGE_SIZE) } return ( @@ -206,8 +210,8 @@ export const Expo = (props: Props) => { )} - 0} keyed={true}> - + 0} keyed={true}> + {(shout) => ( @@ -220,8 +224,8 @@ export const Expo = (props: Props) => { )} - 0} keyed={true}> - + 0} keyed={true}> + {(page) => (