Skip to content

Commit

Permalink
Merge pull request #15897 from Expensify/jasper-fixOpenReportNotCalle…
Browse files Browse the repository at this point in the history
…dDeepLinkingWithinApp

Always call OpenReport when deeplinking within the app

(cherry picked from commit 0553fee)
  • Loading branch information
mountiny authored and OSBotify committed Mar 13, 2023
1 parent 8eb079d commit 6580823
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import styles from '../../../styles/styles';
import Navigation from '../../../libs/Navigation/Navigation';
import AnchorForCommentsOnly from '../../AnchorForCommentsOnly';
import AnchorForAttachmentsOnly from '../../AnchorForAttachmentsOnly';
import * as Report from '../../../libs/actions/Report';
import * as Url from '../../../libs/Url';
import ROUTES from '../../../ROUTES';

Expand Down Expand Up @@ -47,6 +48,11 @@ const AnchorRenderer = (props) => {
// If we are handling a New Expensify link then we will assume this should be opened by the app internally. This ensures that the links are opened internally via react-navigation
// instead of in a new tab or with a page refresh (which is the default behavior of an anchor tag)
if (internalNewExpensifyPath) {
if (attrPath.indexOf('r/') === 0) {
const reportID = attrPath.split('/')[1];
Report.openReport(reportID);
}

Navigation.navigate(internalNewExpensifyPath);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class ReportScreen extends React.Component {
)}
>
<FullPageNotFoundView
shouldShow={!this.props.report.reportID}
shouldShow={!this.props.report.reportID && !this.props.report.isLoadingReportActions}
subtitleKey="notFound.noAccess"
shouldShowCloseButton={false}
shouldShowBackButton={this.props.isSmallScreenWidth}
Expand Down

0 comments on commit 6580823

Please sign in to comment.