From 80889455b5a931a8e5793cceb4536e32538fcfd9 Mon Sep 17 00:00:00 2001 From: Jasper Huang Date: Mon, 13 Mar 2023 14:48:38 -0400 Subject: [PATCH] fix review comments --- .../HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js b/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js index cac01ca0b238..1abe6f111513 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js +++ b/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js @@ -48,7 +48,9 @@ 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) { + // If we're navigating to a report, we need to call OpenReport here since componentDidMount doesn't get called + // when we're deeplinking to a report from a different report (it never unmounts). + if (attrPath.startsWith('r/')) { const reportID = attrPath.split('/')[1]; Report.openReport(reportID); }