diff --git a/src/pages/home/report/ReportActionsView.tsx b/src/pages/home/report/ReportActionsView.tsx index c608a3105675..f59539d97ad3 100755 --- a/src/pages/home/report/ReportActionsView.tsx +++ b/src/pages/home/report/ReportActionsView.tsx @@ -10,7 +10,6 @@ import useInitialValue from '@hooks/useInitialValue'; import useNetwork from '@hooks/useNetwork'; import usePrevious from '@hooks/usePrevious'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; -import useWindowDimensions from '@hooks/useWindowDimensions'; import DateUtils from '@libs/DateUtils'; import getIsReportFullyVisible from '@libs/getIsReportFullyVisible'; import type {AuthScreensParamList} from '@libs/Navigation/types'; @@ -79,9 +78,6 @@ type ReportActionsViewProps = ReportActionsViewOnyxProps & { transactionThreadReportID?: string | null; }; -const DIFF_BETWEEN_SCREEN_HEIGHT_AND_LIST = 120; -const SPACER = 16; - let listOldID = Math.round(Math.random() * 100); function ReportActionsView({ @@ -114,7 +110,6 @@ function ReportActionsView({ const isFirstLinkedActionRender = useRef(true); const network = useNetwork(); - const {windowHeight} = useWindowDimensions(); const {shouldUseNarrowLayout} = useResponsiveLayout(); const contentListHeight = useRef(0); const isFocused = useIsFocused(); @@ -342,8 +337,6 @@ function ReportActionsView({ contentListHeight.current = h; }, []); - const checkIfContentSmallerThanList = useCallback(() => windowHeight - DIFF_BETWEEN_SCREEN_HEIGHT_AND_LIST - SPACER > contentListHeight.current, [windowHeight]); - /** * Retrieves the next set of report actions for the chat once we are nearing the end of what we are currently * displaying. @@ -397,10 +390,6 @@ function ReportActionsView({ const loadNewerChats = useCallback( (force = false) => { - // Determines if loading older reports is necessary when the content is smaller than the list - // and there are fewer than 23 items, indicating we've reached the oldest message. - const isLoadingOlderReportsFirstNeeded = checkIfContentSmallerThanList() && reportActions.length > 23; - if ( !force && (!reportActionID || @@ -417,18 +406,16 @@ function ReportActionsView({ didLoadNewerChats.current = true; - if ((reportActionID && indexOfLinkedAction > -1 && !isLoadingOlderReportsFirstNeeded) || (!reportActionID && !isLoadingOlderReportsFirstNeeded)) { + if ((reportActionID && indexOfLinkedAction > -1) || !reportActionID) { handleReportActionPagination({firstReportActionID: newestReportAction?.reportActionID}); } }, [ isLoadingInitialReportActions, isLoadingNewerReportActions, - checkIfContentSmallerThanList, reportActionID, indexOfLinkedAction, handleReportActionPagination, - reportActions.length, newestReportAction, isFocused, hasLoadingNewerReportActionsError,