diff --git a/src/pages/home/report/ReportActionsList.js b/src/pages/home/report/ReportActionsList.js index 11c8077745f..759e73aa90e 100644 --- a/src/pages/home/report/ReportActionsList.js +++ b/src/pages/home/report/ReportActionsList.js @@ -365,9 +365,10 @@ function ReportActionsList({ const lastReportAction = useMemo(() => _.last(sortedReportActions) || {}, [sortedReportActions]); const listFooterComponent = useCallback(() => { - // Skip this hook on the first render, as we are not sure if more actions are going to be loaded - // Therefore showing the skeleton on footer might be misleading - if (!hasFooterRendered.current) { + // Skip this hook on the first render (when online), as we are not sure if more actions are going to be loaded, + // Therefore showing the skeleton on footer might be misleading. + // When offline, there should be no second render, so we should show the skeleton if the corresponding loading prop is present + if (!isOffline && !hasFooterRendered.current) { hasFooterRendered.current = true; return null; } @@ -380,7 +381,7 @@ function ReportActionsList({ lastReportActionName={lastReportAction.actionName} /> ); - }, [isLoadingInitialReportActions, isLoadingOlderReportActions, lastReportAction.actionName]); + }, [isLoadingInitialReportActions, isLoadingOlderReportActions, lastReportAction.actionName, isOffline]); const onLayoutInner = useCallback( (event) => { @@ -390,17 +391,18 @@ function ReportActionsList({ ); const listHeaderComponent = useCallback(() => { - if (!hasHeaderRendered.current) { + if (!isOffline && !hasHeaderRendered.current) { hasHeaderRendered.current = true; return null; } + return ( ); - }, [isLoadingNewerReportActions]); + }, [isLoadingNewerReportActions, isOffline]); return ( <> diff --git a/src/pages/home/report/ReportActionsView.js b/src/pages/home/report/ReportActionsView.js index 28ddcd94dfb..01ec967d76b 100755 --- a/src/pages/home/report/ReportActionsView.js +++ b/src/pages/home/report/ReportActionsView.js @@ -177,8 +177,8 @@ function ReportActionsView(props) { * displaying. */ const loadOlderChats = () => { - // Only fetch more if we are not already fetching so that we don't initiate duplicate requests. - if (props.isLoadingOlderReportActions) { + // Only fetch more if we are neither already fetching (so that we don't initiate duplicate requests) nor offline. + if (props.network.isOffline || props.isLoadingOlderReportActions) { return; }