From fd58bf12a0cbe00a91b08b89e9e75b147c8319e2 Mon Sep 17 00:00:00 2001 From: DylanDylann Date: Fri, 26 Jan 2024 05:50:28 +0700 Subject: [PATCH 1/2] fix not here page appear when refreshing --- .../createCustomStackNavigator/CustomRouter.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libs/Navigation/AppNavigator/createCustomStackNavigator/CustomRouter.ts b/src/libs/Navigation/AppNavigator/createCustomStackNavigator/CustomRouter.ts index 020719e2dc36..cda6b773c861 100644 --- a/src/libs/Navigation/AppNavigator/createCustomStackNavigator/CustomRouter.ts +++ b/src/libs/Navigation/AppNavigator/createCustomStackNavigator/CustomRouter.ts @@ -1,6 +1,7 @@ import type {NavigationState, PartialState, RouterConfigOptions, StackNavigationState} from '@react-navigation/native'; import {StackRouter} from '@react-navigation/native'; import type {ParamListBase} from '@react-navigation/routers'; +import CONST from '@src/CONST'; import NAVIGATORS from '@src/NAVIGATORS'; import SCREENS from '@src/SCREENS'; import type {ResponsiveStackNavigatorRouterOptions} from './types'; @@ -21,6 +22,14 @@ const getTopMostReportIDFromRHP = (state: State): string => { } const topmostRoute = state.routes.at(-1); + if ( + topmostRoute?.params && + 'iouType' in topmostRoute.params && + typeof topmostRoute.params.iouType === 'string' && + (topmostRoute.params.iouType === CONST.IOU.TYPE.REQUEST || topmostRoute.params.iouType === CONST.IOU.TYPE.SEND || topmostRoute.params.iouType === CONST.IOU.TYPE.SPLIT) + ) { + return ''; + } if (topmostRoute?.state) { return getTopMostReportIDFromRHP(topmostRoute.state); From f3b4b68123889a4bbdafe4115cf428de0ddb9eee Mon Sep 17 00:00:00 2001 From: DylanDylann Date: Sat, 27 Jan 2024 11:40:10 +0700 Subject: [PATCH 2/2] fix add comment --- .../AppNavigator/createCustomStackNavigator/CustomRouter.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/Navigation/AppNavigator/createCustomStackNavigator/CustomRouter.ts b/src/libs/Navigation/AppNavigator/createCustomStackNavigator/CustomRouter.ts index cda6b773c861..0ca5417e9f6e 100644 --- a/src/libs/Navigation/AppNavigator/createCustomStackNavigator/CustomRouter.ts +++ b/src/libs/Navigation/AppNavigator/createCustomStackNavigator/CustomRouter.ts @@ -22,6 +22,9 @@ const getTopMostReportIDFromRHP = (state: State): string => { } const topmostRoute = state.routes.at(-1); + + // In the case of money requests, send money and split bill, + // we want to ignore the associated report and fall back to the default navigation behavior if ( topmostRoute?.params && 'iouType' in topmostRoute.params &&