Skip to content

Commit

Permalink
fix: delay loading of newer chat until reported list render is complete
Browse files Browse the repository at this point in the history
  • Loading branch information
huult committed Sep 20, 2024
1 parent bacfcc8 commit 2cbfd5d
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/pages/home/report/ReportActionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ function ReportActionsList({
}, [isLoadingNewerReportActions, canShowHeader, hasLoadingNewerReportActionsError, retryLoadNewerChatsError]);

const onStartReached = useCallback(() => {
loadNewerChats(false);
InteractionManager.runAfterInteractions(() => requestAnimationFrame(() => loadNewerChats(false)));
}, [loadNewerChats]);

const onEndReached = useCallback(() => {
Expand Down Expand Up @@ -655,13 +655,7 @@ function ReportActionsList({
initialNumToRender={initialNumToRender}
onEndReached={onEndReached}
onEndReachedThreshold={0.75}
onStartReached={() => {
InteractionManager.runAfterInteractions(() => {
requestAnimationFrame(() => {
onStartReached();
});
});
}}
onStartReached={onStartReached}
onStartReachedThreshold={0.75}
ListFooterComponent={listFooterComponent}
ListHeaderComponent={listHeaderComponent}
Expand Down

0 comments on commit 2cbfd5d

Please sign in to comment.