Skip to content

Commit

Permalink
change variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusbra committed Apr 27, 2022
1 parent 56a72e3 commit 3a41612
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ 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 internalExpensifyPath = (attrHref.startsWith(CONST.NEW_EXPENSIFY_URL) && attrHref.replace(CONST.NEW_EXPENSIFY_URL, ''))
const internalNewExpensifyPath = (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 oldDotPath = attrHref.startsWith(CONFIG.EXPENSIFY.EXPENSIFY_URL) && attrHref.replace(CONFIG.EXPENSIFY.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 (internalExpensifyPath || oldDotPath) {
if (internalNewExpensifyPath || internalExpensifyPath) {
return (
<Text
style={styles.link}
onPress={() => (internalExpensifyPath ? Navigation.navigate(internalExpensifyPath) : Link.openOldDotLink(oldDotPath))}
onPress={() => (internalNewExpensifyPath ? Navigation.navigate(internalNewExpensifyPath) : Link.openOldDotLink(internalExpensifyPath))}
>
<TNodeChildrenRenderer tnode={props.tnode} />
</Text>
Expand Down

0 comments on commit 3a41612

Please sign in to comment.