Skip to content

Commit

Permalink
Merge pull request #18601 from abdulrahuman5196/RemoveDefaultWorkspac…
Browse files Browse the repository at this point in the history
…eMessage
  • Loading branch information
thienlnam authored May 10, 2023
2 parents d3d0402 + 000fbb3 commit c50a048
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/pages/workspace/WorkspaceInviteMessagePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,23 @@ class WorkspaceInviteMessagePage extends React.Component {
this.validate = this.validate.bind(this);
this.openPrivacyURL = this.openPrivacyURL.bind(this);
this.state = {
welcomeNote: this.getWelcomeNote(),
welcomeNote: this.getDefaultWelcomeNote(),
};
}

componentDidUpdate(prevProps) {
if (
!(
prevProps.preferredLocale !== this.props.preferredLocale &&
this.state.welcomeNote === Localize.translate(prevProps.preferredLocale, 'workspace.inviteMessage.welcomeNote', {workspaceName: this.props.policy.name})
(prevProps.preferredLocale !== this.props.preferredLocale || prevProps.policy.name !== this.props.policy.name) &&
this.state.welcomeNote === Localize.translate(prevProps.preferredLocale, 'workspace.inviteMessage.welcomeNote', {workspaceName: prevProps.policy.name})
)
) {
return;
}
this.setState({welcomeNote: this.getWelcomeNote()});
this.setState({welcomeNote: this.getDefaultWelcomeNote()});
}

getWelcomeNote() {
getDefaultWelcomeNote() {
return this.props.translate('workspace.inviteMessage.welcomeNote', {
workspaceName: this.props.policy.name,
});
Expand All @@ -102,7 +102,7 @@ class WorkspaceInviteMessagePage extends React.Component {
}

sendInvitation() {
Policy.addMembersToWorkspace(this.props.invitedMembersDraft, this.state.welcomeNote || this.getWelcomeNote(), this.props.route.params.policyID, this.props.betas);
Policy.addMembersToWorkspace(this.props.invitedMembersDraft, this.state.welcomeNote, this.props.route.params.policyID, this.props.betas);
Policy.setWorkspaceInviteMembersDraft(this.props.route.params.policyID, []);
Navigation.navigate(ROUTES.getWorkspaceMembersRoute(this.props.route.params.policyID));
}
Expand Down

0 comments on commit c50a048

Please sign in to comment.