From 915988c8914e0c76ec8785c5e077332de290c3b3 Mon Sep 17 00:00:00 2001
From: Jack Nam <30609178+thienlnam@users.noreply.github.com>
Date: Wed, 11 May 2022 14:11:49 -0700
Subject: [PATCH] Revert "Open old dot links with openOldDotLink() function"
---
.../HTMLRenderers/AnchorRenderer.js | 19 ++-----------------
1 file changed, 2 insertions(+), 17 deletions(-)
diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js b/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js
index bf70adda9f07..e768e59bbf98 100644
--- a/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js
+++ b/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js
@@ -8,11 +8,9 @@ import htmlRendererPropTypes from './htmlRendererPropTypes';
import * as HTMLEngineUtils from '../htmlEngineUtils';
import Text from '../../Text';
import CONST from '../../../CONST';
-import CONFIG from '../../../CONFIG';
import styles from '../../../styles/styles';
import Navigation from '../../../libs/Navigation/Navigation';
import AnchorForCommentsOnly from '../../AnchorForCommentsOnly';
-import * as Link from '../../../libs/actions/Link';
const AnchorRenderer = (props) => {
const htmlAttribs = props.tnode.attributes;
@@ -22,29 +20,16 @@ const AnchorRenderer = (props) => {
const displayName = lodashGet(props.tnode, 'domNode.children[0].data', '');
const parentStyle = lodashGet(props.tnode, 'parent.styles.nativeTextRet', {});
const attrHref = htmlAttribs.href || '';
- const internalNewExpensifyPath = (attrHref.startsWith(CONST.NEW_EXPENSIFY_URL) && attrHref.replace(CONST.NEW_EXPENSIFY_URL, ''))
+ const internalExpensifyPath = (attrHref.startsWith(CONST.NEW_EXPENSIFY_URL) && attrHref.replace(CONST.NEW_EXPENSIFY_URL, ''))
|| (attrHref.startsWith(CONST.STAGING_NEW_EXPENSIFY_URL) && attrHref.replace(CONST.STAGING_NEW_EXPENSIFY_URL, ''));
- const internalExpensifyPath = attrHref.startsWith(CONFIG.EXPENSIFY.EXPENSIFY_URL) && attrHref.replace(CONFIG.EXPENSIFY.EXPENSIFY_URL, '');
// 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) {
- return (
- Navigation.navigate(internalNewExpensifyPath)}
- >
-
-
- );
- }
-
- // If we are handling an old dot Expensify link we need to open it with openOldDotLink() so we can navigate to it with the user already logged in.
if (internalExpensifyPath) {
return (
Link.openOldDotLink(internalExpensifyPath)}
+ onPress={() => Navigation.navigate(internalExpensifyPath)}
>