Skip to content

Commit

Permalink
Merge pull request #10310 from Expensify/arosiclair-concierge-link-ha…
Browse files Browse the repository at this point in the history
…ndling

Exclude concierge links from OldDot link handling
  • Loading branch information
aldo-expensify authored Aug 10, 2022
2 parents 521102a + 3f9f8a8 commit bd75a5f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/CONFIG.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const secureExpensifyUrl = Url.addTrailingForwardSlash(lodashGet(
const useNgrok = lodashGet(Config, 'USE_NGROK', 'false') === 'true';
const useWebProxy = lodashGet(Config, 'USE_WEB_PROXY', 'true') === 'true';
const expensifyComWithProxy = getPlatform() === 'web' && useWebProxy ? '/' : expensifyURL;
const conciergeUrl = `${expensifyURL}concierge/`;

// Throw errors on dev if config variables are not set correctly
if (ENVIRONMENT === CONST.ENVIRONMENT.DEV) {
Expand Down Expand Up @@ -48,6 +49,7 @@ export default {
PARTNER_NAME: lodashGet(Config, 'EXPENSIFY_PARTNER_NAME', 'chat-expensify-com'),
PARTNER_PASSWORD: lodashGet(Config, 'EXPENSIFY_PARTNER_PASSWORD', 'e21965746fd75f82bb66'),
EXPENSIFY_CASH_REFERER: 'ecash',
CONCIERGE_URL: conciergeUrl,
},
IS_IN_PRODUCTION: Platform.OS === 'web' ? process.env.NODE_ENV === 'production' : !__DEV__,
IS_USING_LOCAL_WEB: useNgrok || expensifyURLRoot.includes('dev'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ const AnchorRenderer = (props) => {
const attrHref = htmlAttribs.href || '';
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 internalExpensifyPath = attrHref.startsWith(CONFIG.EXPENSIFY.EXPENSIFY_URL) && attrHref.replace(CONFIG.EXPENSIFY.EXPENSIFY_URL, '');
const internalExpensifyPath = attrHref.startsWith(CONFIG.EXPENSIFY.EXPENSIFY_URL)
&& !attrHref.startsWith(CONFIG.EXPENSIFY.CONCIERGE_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)
Expand All @@ -39,7 +41,7 @@ const AnchorRenderer = (props) => {
);
}

// 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 we are handling an old dot Expensify link (excluding Concierge) we need to open it with openOldDotLink() so we can navigate to it with the user already logged in.
// As attachments also use expensify.com we don't want it working the same as links.
if (internalExpensifyPath && !isAttachment) {
return (
Expand Down

0 comments on commit bd75a5f

Please sign in to comment.