From af2c25fab8251fda5107a33e4acb9bb0783a3b0b Mon Sep 17 00:00:00 2001 From: allgandalf Date: Thu, 9 Oct 2025 12:34:44 +0530 Subject: [PATCH 1/2] do not call openReport, when we are in the transition URL on mount of the application --- .../Navigators/ReportsSplitNavigator.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/libs/Navigation/AppNavigator/Navigators/ReportsSplitNavigator.tsx b/src/libs/Navigation/AppNavigator/Navigators/ReportsSplitNavigator.tsx index 5c8ff99b55ff..5ff9fe16bfbe 100644 --- a/src/libs/Navigation/AppNavigator/Navigators/ReportsSplitNavigator.tsx +++ b/src/libs/Navigation/AppNavigator/Navigators/ReportsSplitNavigator.tsx @@ -1,4 +1,4 @@ -import React, {useState} from 'react'; +import React, {useMemo, useState} from 'react'; import usePermissions from '@hooks/usePermissions'; import createSplitNavigator from '@libs/Navigation/AppNavigator/createSplitNavigator'; import FreezeWrapper from '@libs/Navigation/AppNavigator/FreezeWrapper'; @@ -11,6 +11,7 @@ import type {AuthScreensParamList, ReportsSplitNavigatorParamList} from '@libs/N import * as ReportUtils from '@libs/ReportUtils'; import CONST from '@src/CONST'; import type NAVIGATORS from '@src/NAVIGATORS'; +import ROUTES from '@src/ROUTES'; import SCREENS from '@src/SCREENS'; import type ReactComponentModule from '@src/types/utils/ReactComponentModule'; @@ -26,6 +27,12 @@ function ReportsSplitNavigator({route}: PlatformStackScreenProps { + const currentURL = getCurrentUrl(); + return currentURL.includes(ROUTES.TRANSITION_BETWEEN_APPS); + }, []); + const [initialReportID] = useState(() => { const currentURL = getCurrentUrl(); const reportIdFromPath = currentURL && new URL(currentURL).pathname.match(CONST.REGEX.REPORT_ID_FROM_PATH)?.at(1); @@ -33,6 +40,12 @@ function ReportsSplitNavigator({route}: PlatformStackScreenProps Date: Thu, 9 Oct 2025 13:53:38 +0530 Subject: [PATCH 2/2] Apply suggestion from @allgandalf --- .../AppNavigator/Navigators/ReportsSplitNavigator.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/Navigation/AppNavigator/Navigators/ReportsSplitNavigator.tsx b/src/libs/Navigation/AppNavigator/Navigators/ReportsSplitNavigator.tsx index 5ff9fe16bfbe..6d6661d3aa78 100644 --- a/src/libs/Navigation/AppNavigator/Navigators/ReportsSplitNavigator.tsx +++ b/src/libs/Navigation/AppNavigator/Navigators/ReportsSplitNavigator.tsx @@ -27,7 +27,7 @@ function ReportsSplitNavigator({route}: PlatformStackScreenProps { const currentURL = getCurrentUrl(); return currentURL.includes(ROUTES.TRANSITION_BETWEEN_APPS);