Skip to content

Commit

Permalink
Move to Const.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
nkdengineer committed Dec 12, 2024
1 parent 5331afd commit b07ab52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,14 @@ const CONST = {
EMPLOYEE_TOUR_PRODUCTION: 'https://expensify.navattic.com/35609gb',
EMPLOYEE_TOUR_STAGING: 'https://expensify.navattic.com/cf15002s',
},

OLD_DOT_PUBLIC_URLS: {
TERMS_URL: `${EXPENSIFY_URL}/terms`,
PRIVACY_URL: `${EXPENSIFY_URL}/privacy`,
LICENSES_URL: `${USE_EXPENSIFY_URL}/licenses`,
ACH_TERMS_URL: `${EXPENSIFY_URL}/achterms`,
WALLET_AGREEMENT_URL: `${EXPENSIFY_URL}/expensify-payments-wallet-terms-of-service`,
BANCORP_WALLET_AGREEMENT_URL: `${EXPENSIFY_URL}/bancorp-bank-wallet-terms-of-service`,
},
OLDDOT_URLS: {
ADMIN_POLICIES_URL: 'admin_policies',
ADMIN_DOMAINS_URL: 'admin_domains',
Expand Down
4 changes: 1 addition & 3 deletions src/libs/actions/Link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,9 @@ function openLink(href: string, environmentURL: string, isAttachment = false) {
Navigation.navigate(internalNewExpensifyPath as Route);
return;
}
const OLD_DOT_PUBLIC_URLS: string[] = [CONST.TERMS_URL, CONST.PRIVACY_URL];

// 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.
// As attachments also use expensify.com we don't want it working the same as links.
const isPublicOldDotURL = OLD_DOT_PUBLIC_URLS.includes(href);
const isPublicOldDotURL = (Object.values(CONST.OLD_DOT_PUBLIC_URLS) as string[]).includes(href);
if (internalExpensifyPath && !isAttachment && !isPublicOldDotURL) {
openOldDotLink(internalExpensifyPath);
return;
Expand Down

0 comments on commit b07ab52

Please sign in to comment.