Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix creating free workspaces from OldDot #32691

Merged
merged 9 commits into from
Dec 7, 2023
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
8 changes: 8 additions & 0 deletions src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -2002,6 +2002,14 @@ function openReportFromDeepLink(url, isAuthenticated) {
Session.signOutAndRedirectToSignIn();
return;
}

// We don't want to navigate to the exitTo route when creating a new workspace from a deep link,
// because we already handle creating the optimistic policy and navigating to it in App.setUpPoliciesAndNavigate,
// which is already called when AuthScreens mounts.
if (new URL(url).searchParams.get('exitTo') === ROUTES.WORKSPACE_NEW) {
return;
}

Navigation.navigate(route, CONST.NAVIGATION.ACTION_TYPE.PUSH);
});
});
Expand Down
6 changes: 5 additions & 1 deletion src/pages/LogOutPreviousUserPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import * as SessionUtils from '@libs/SessionUtils';
import Navigation from '@navigation/Navigation';
import * as Session from '@userActions/Session';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';

const propTypes = {
/** The details about the account that the user is signing in with */
Expand Down Expand Up @@ -54,7 +55,10 @@ function LogOutPreviousUserPage(props) {
}

const exitTo = lodashGet(props, 'route.params.exitTo', '');
if (exitTo && !props.account.isLoading && !isLoggingInAsNewUser) {
// We don't want to navigate to the exitTo route when creating a new workspace from a deep link,
// because we already handle creating the optimistic policy and navigating to it in App.setUpPoliciesAndNavigate,
// which is already called when AuthScreens mounts.
if (exitTo && exitTo !== ROUTES.WORKSPACE_NEW && !props.account.isLoading && !isLoggingInAsNewUser) {
Navigation.isNavigationReady().then(() => {
Navigation.navigate(exitTo);
});
Expand Down
Loading