Skip to content

Commit

Permalink
Merge pull request #5868 from Expensify/aldo_fix-missing-workspace-mo…
Browse files Browse the repository at this point in the history
…bile
  • Loading branch information
roryabraham authored Oct 15, 2021
2 parents bf660aa + 6086b07 commit 3aeb62f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/libs/Navigation/AppNavigator/AuthScreens.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,15 @@ class AuthScreens extends React.Component {
// Load policies, maybe creating a new policy first.
Linking.getInitialURL()
.then((url) => {
const path = new URL(url).pathname;
const exitTo = new URLSearchParams(url).get('exitTo');
const shouldCreateFreePolicy = Str.startsWith(path, Str.normalizeUrl(ROUTES.LOGIN_WITH_SHORT_LIVED_TOKEN)) && exitTo === ROUTES.WORKSPACE_NEW;
getPolicyList(shouldCreateFreePolicy);
// url is null on mobile unless the app was opened via a deeplink
if (url) {
const path = new URL(url).pathname;
const exitTo = new URLSearchParams(url).get('exitTo');
const shouldCreateFreePolicy = Str.startsWith(path, Str.normalizeUrl(ROUTES.LOGIN_WITH_SHORT_LIVED_TOKEN)) && exitTo === ROUTES.WORKSPACE_NEW;
getPolicyList(shouldCreateFreePolicy);
} else {
getPolicyList(false);
}
});

// Refresh the personal details, timezone and betas every 30 minutes
Expand Down

0 comments on commit 3aeb62f

Please sign in to comment.