Skip to content

Commit

Permalink
Merge pull request #29227 from saranshbalyan-1234/fix-crash-on-deep-l…
Browse files Browse the repository at this point in the history
…ink-request-page

Fix crash on deep link request page
  • Loading branch information
tgolen authored Oct 11, 2023
2 parents d7b1deb + 9a95dd6 commit 110993f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/pages/EditRequestPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import EditRequestCategoryPage from './EditRequestCategoryPage';
import EditRequestTagPage from './EditRequestTagPage';
import categoryPropTypes from '../components/categoryPropTypes';
import ScreenWrapper from '../components/ScreenWrapper';
import transactionPropTypes from '../components/transactionPropTypes';

const propTypes = {
/** Route from navigation */
Expand Down Expand Up @@ -75,6 +76,9 @@ const propTypes = {
/** Collection of tags attached to a policy */
policyTags: tagPropTypes,

/** The original transaction that is being edited */
transaction: transactionPropTypes,

...withCurrentUserPersonalDetailsPropTypes,
};

Expand All @@ -88,10 +92,12 @@ const defaultProps = {
},
policyCategories: {},
policyTags: {},
transaction: {},
};

function EditRequestPage({betas, report, route, parentReport, policy, session, policyCategories, policyTags, parentReportActions, transaction}) {
const parentReportAction = parentReportActions[report.parentReportActionID];
const parentReportActionID = lodashGet(report, 'parentReportActionID', '0');
const parentReportAction = lodashGet(parentReportActions, parentReportActionID);
const {
amount: transactionAmount,
currency: transactionCurrency,
Expand Down Expand Up @@ -321,7 +327,8 @@ export default compose(
withOnyx({
transaction: {
key: ({report, parentReportActions}) => {
const parentReportAction = lodashGet(parentReportActions, [report.parentReportActionID]);
const parentReportActionID = lodashGet(report, 'parentReportActionID', '0');
const parentReportAction = lodashGet(parentReportActions, parentReportActionID);
return `${ONYXKEYS.COLLECTION.TRANSACTION}${lodashGet(parentReportAction, 'originalMessage.IOUTransactionID', 0)}`;
},
},
Expand Down

0 comments on commit 110993f

Please sign in to comment.