From 01a2f1fad55318b2770152c56a3c1d3b0b51e776 Mon Sep 17 00:00:00 2001 From: Huu Le <20178761+huult@users.noreply.github.com> Date: Wed, 6 Nov 2024 22:30:35 +0700 Subject: [PATCH] fix prevent brief hiding of Expense preview when returning to report via header subtitle --- src/pages/home/report/ReportActionsList.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionsList.tsx b/src/pages/home/report/ReportActionsList.tsx index 58e7fe319359..e6edfce0dbcf 100644 --- a/src/pages/home/report/ReportActionsList.tsx +++ b/src/pages/home/report/ReportActionsList.tsx @@ -20,6 +20,7 @@ import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import DateUtils from '@libs/DateUtils'; +import isSearchTopmostCentralPane from '@libs/Navigation/isSearchTopmostCentralPane'; import Navigation from '@libs/Navigation/Navigation'; import * as ReportActionsUtils from '@libs/ReportActionsUtils'; import * as ReportUtils from '@libs/ReportUtils'; @@ -699,7 +700,13 @@ function ReportActionsList({ }, [isLoadingNewerReportActions, canShowHeader, hasLoadingNewerReportActionsError, retryLoadNewerChatsError]); const onStartReached = useCallback(() => { - InteractionManager.runAfterInteractions(() => requestAnimationFrame(() => loadNewerChats(false))); + const loadChats = () => loadNewerChats(false); + + if (isSearchTopmostCentralPane()) { + InteractionManager.runAfterInteractions(() => requestAnimationFrame(loadChats)); + } else { + loadChats(); + } }, [loadNewerChats]); const onEndReached = useCallback(() => {