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

feat: redirect to workspace after creation #19224

Merged
merged 5 commits into from
May 22, 2023
Merged
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
7 changes: 6 additions & 1 deletion src/libs/actions/Policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as API from '../API';
import ONYXKEYS from '../../ONYXKEYS';
import CONST from '../../CONST';
import * as Localize from '../Localize';
import Navigation from '../Navigation/Navigation';
import Navigation, {navigationRef} from '../Navigation/Navigation';
import ROUTES from '../../ROUTES';
import * as OptionsListUtils from '../OptionsListUtils';
import DateUtils from '../DateUtils';
Expand Down Expand Up @@ -1082,6 +1082,11 @@ function createWorkspace(ownerEmail = '', makeMeAdmin = false, policyName = '',
if (transitionFromOldDot) {
Navigation.dismissModal(); // Dismiss /transition route for OldDot to NewDot transitions
}

// Get the reportID associated with the newly created #admins room and route the user to that chat
const routeKey = lodashGet(navigationRef.getState(), 'routes[0].state.routes[0].key');
Navigation.setParams({reportID: adminsChatReportID}, routeKey);
NikkiWines marked this conversation as resolved.
Show resolved Hide resolved

Navigation.navigate(ROUTES.getWorkspaceInitialRoute(policyID));
});
}
Expand Down