diff --git a/src/pages/home/sidebar/SidebarLinks.tsx b/src/pages/home/sidebar/SidebarLinks.tsx index 2e84f9805f6a..1985c6500d52 100644 --- a/src/pages/home/sidebar/SidebarLinks.tsx +++ b/src/pages/home/sidebar/SidebarLinks.tsx @@ -68,7 +68,16 @@ function SidebarLinks({insets, optionListItems, isLoading, priorityMode = CONST. // or when continuously clicking different LHNs, only apply to small screen // since getTopmostReportId always returns on other devices const reportActionID = Navigation.getTopmostReportActionId(); - if ((option.reportID === Navigation.getTopmostReportId() && !reportActionID) || (shouldUseNarrowLayout && isActiveReport(option.reportID) && !reportActionID)) { + + // Prevent opening a new Report page if the user quickly taps on another conversation + // before the first one is displayed. + const shouldBlockReportNavigation = Navigation.getActiveRoute() !== '/home' && shouldUseNarrowLayout; + + if ( + (option.reportID === Navigation.getTopmostReportId() && !reportActionID) || + (shouldUseNarrowLayout && isActiveReport(option.reportID) && !reportActionID) || + shouldBlockReportNavigation + ) { return; } Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(option.reportID)); diff --git a/tests/perf-test/SidebarLinks.perf-test.tsx b/tests/perf-test/SidebarLinks.perf-test.tsx index f6b9a6758b25..58663217c92a 100644 --- a/tests/perf-test/SidebarLinks.perf-test.tsx +++ b/tests/perf-test/SidebarLinks.perf-test.tsx @@ -15,6 +15,7 @@ jest.mock('../../src/libs/Navigation/Navigation', () => ({ navigate: jest.fn(), isActiveRoute: jest.fn(), getTopmostReportId: jest.fn(), + getActiveRoute: jest.fn(), getTopmostReportActionId: jest.fn(), isNavigationReady: jest.fn(() => Promise.resolve()), isDisplayedInModal: jest.fn(() => false),