diff --git a/src/pages/workspace/WorkspaceInviteMessagePage.js b/src/pages/workspace/WorkspaceInviteMessagePage.js index f91da6c12a8d..349aa0d8a195 100644 --- a/src/pages/workspace/WorkspaceInviteMessagePage.js +++ b/src/pages/workspace/WorkspaceInviteMessagePage.js @@ -42,6 +42,9 @@ const propTypes = { /** All of the personal details for everyone */ personalDetails: PropTypes.objectOf(personalDetailsPropTypes), + /** Beta features list */ + betas: PropTypes.arrayOf(PropTypes.string), + invitedMembersDraft: PropTypes.arrayOf(PropTypes.string), /** URL Route params */ @@ -60,6 +63,7 @@ const propTypes = { const defaultProps = { ...policyDefaultProps, personalDetails: {}, + betas: [], invitedMembersDraft: [], }; @@ -109,7 +113,7 @@ class WorkspaceInviteMessagePage extends React.Component { } sendInvitation() { - Policy.addMembersToWorkspace(this.props.invitedMembersDraft, this.state.welcomeNote || this.getWelcomeNote(), this.props.route.params.policyID); + Policy.addMembersToWorkspace(this.props.invitedMembersDraft, this.state.welcomeNote || this.getWelcomeNote(), this.props.route.params.policyID, this.props.betas); Policy.setWorkspaceInviteMembersDraft(this.props.route.params.policyID, []); Navigation.navigate(ROUTES.getWorkspaceMembersRoute(this.props.route.params.policyID)); } @@ -221,6 +225,9 @@ export default compose( personalDetails: { key: ONYXKEYS.PERSONAL_DETAILS, }, + betas: { + key: ONYXKEYS.BETAS, + }, invitedMembersDraft: { key: ({route}) => `${ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MEMBERS_DRAFT}${route.params.policyID.toString()}`, }, diff --git a/src/pages/workspace/WorkspaceInvitePage.js b/src/pages/workspace/WorkspaceInvitePage.js index 8aff82ffb281..8881c8bf2ca2 100644 --- a/src/pages/workspace/WorkspaceInvitePage.js +++ b/src/pages/workspace/WorkspaceInvitePage.js @@ -89,7 +89,6 @@ class WorkspaceInvitePage extends React.Component { personalDetails, selectedOptions: [], userToInvite, - shouldDisableButton: false, }; } @@ -247,16 +246,14 @@ class WorkspaceInvitePage extends React.Component { return; } - this.setState({shouldDisableButton: true}, () => { - const logins = _.map(this.state.selectedOptions, option => option.login); - const filteredLogins = _.chain(logins) - .map(login => login.toLowerCase().trim()) - .compact() - .uniq() - .value(); - Policy.setWorkspaceInviteMembersDraft(this.props.route.params.policyID, filteredLogins); - Navigation.navigate(ROUTES.getWorkspaceInviteMessageRoute(this.props.route.params.policyID)); - }); + const logins = _.map(this.state.selectedOptions, option => option.login); + const filteredLogins = _.chain(logins) + .map(login => login.toLowerCase().trim()) + .compact() + .uniq() + .value(); + Policy.setWorkspaceInviteMembersDraft(this.props.route.params.policyID, filteredLogins); + Navigation.navigate(ROUTES.getWorkspaceInviteMessageRoute(this.props.route.params.policyID)); } /** @@ -321,7 +318,7 @@ class WorkspaceInvitePage extends React.Component {