Skip to content

Commit

Permalink
Merge pull request Expensify#19224 from allroundexperts/fix-18894
Browse files Browse the repository at this point in the history
feat: redirect to workspace after creation
  • Loading branch information
NikkiWines authored May 22, 2023
2 parents fe1bac7 + c90eb1c commit 58dd3c8
Showing 1 changed file with 6 additions and 1 deletion.
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);

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

0 comments on commit 58dd3c8

Please sign in to comment.