diff --git a/src/CONST.js b/src/CONST.js index 2daca29d8bb3..f0ccd47b3a8f 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -2197,6 +2197,9 @@ const CONST = { SAMPLE_INPUT: '123456.789', EXPECTED_OUTPUT: 'FCFA 123,457', }, + PATHS_TO_TREAT_AS_EXTERNAL: [ + 'NewExpensify.dmg', + ], }; export default CONST; diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js b/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js index be8c8a1fc3eb..92c327bc6053 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js +++ b/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js @@ -28,7 +28,8 @@ const AnchorRenderer = (props) => { const attrHref = htmlAttribs.href || ''; const attrPath = lodashGet(Url.getURLObject(attrHref), 'path', '').replace('/', ''); const hasExpensifyOrigin = Url.hasSameExpensifyOrigin(attrHref, CONFIG.EXPENSIFY.EXPENSIFY_URL) || Url.hasSameExpensifyOrigin(attrHref, CONFIG.EXPENSIFY.STAGING_API_ROOT); - const internalNewExpensifyPath = (Url.hasSameExpensifyOrigin(attrHref, CONST.NEW_EXPENSIFY_URL) || Url.hasSameExpensifyOrigin(attrHref, CONST.STAGING_NEW_EXPENSIFY_URL)) && attrPath; + const internalNewExpensifyPath = (Url.hasSameExpensifyOrigin(attrHref, CONST.NEW_EXPENSIFY_URL) || Url.hasSameExpensifyOrigin(attrHref, CONST.STAGING_NEW_EXPENSIFY_URL)) + && !CONST.PATHS_TO_TREAT_AS_EXTERNAL.includes(attrPath) ? attrPath : ''; const internalExpensifyPath = hasExpensifyOrigin && !attrPath.startsWith(CONFIG.EXPENSIFY.CONCIERGE_URL_PATHNAME) && attrPath; @@ -99,7 +100,7 @@ const AnchorRenderer = (props) => { key={props.key} displayName={displayName} - // Only pass the press handler for internal links, for public links fallback to default link handling + // Only pass the press handler for internal links. For public links or whitelisted internal links fallback to default link handling onPress={(internalNewExpensifyPath || internalExpensifyPath) ? navigateToLink : undefined} >