Skip to content

Commit

Permalink
Merge pull request #35210 from DylanDylann/fix/33990-not-here-page-ap…
Browse files Browse the repository at this point in the history
…pear-on-reloading-page-request-money
  • Loading branch information
francoisl authored Jan 29, 2024
2 parents c5ab78f + f3b4b68 commit d507c32
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -22,6 +23,17 @@ 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 &&
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);
}
Expand Down

0 comments on commit d507c32

Please sign in to comment.