Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/components/DeeplinkWrapper/index.website.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ function promptToOpenInDesktopApp(initialUrl = '') {
// 2. There may be non-idempotent operations (e.g. create a new workspace), which obviously should not be executed again in the desktop app.
// So we need to wait until after sign-in and navigation are complete before starting the deeplink redirect.
if (Str.startsWith(window.location.pathname, Str.normalizeUrl(ROUTES.TRANSITION_BETWEEN_APPS))) {
const params = new URLSearchParams(window.location.search);
// If the user is redirected from the desktop app, don't prompt the user to open in desktop.
if (params.get('referrer') === 'desktop') {
return;
}
App.beginDeepLinkRedirectAfterTransition();
} else {
// Match any magic link (/v/<account id>/<6 digit code>)
Expand Down
3 changes: 2 additions & 1 deletion src/libs/actions/Link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ function buildURLWithAuthToken(url: string, shortLivedAuthToken?: string) {
const emailParam = `email=${encodeURIComponent(currentUserEmail)}`;
const exitTo = `exitTo=${url}`;
const accountID = `accountID=${currentUserAccountID}`;
const paramsArray = [accountID, emailParam, authTokenParam, exitTo];
const referrer = 'referrer=desktop';
const paramsArray = [accountID, emailParam, authTokenParam, exitTo, referrer];
const params = paramsArray.filter(Boolean).join('&');

return `${CONFIG.EXPENSIFY.NEW_EXPENSIFY_URL}transition?${params}`;
Expand Down