From 58cf32d971a49e1190860c4614d13f9a956ce530 Mon Sep 17 00:00:00 2001 From: Abdul Rahuman Date: Mon, 8 May 2023 23:56:38 +0530 Subject: [PATCH 1/4] Fixing to not default workspace message --- src/pages/workspace/WorkspaceInviteMessagePage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceInviteMessagePage.js b/src/pages/workspace/WorkspaceInviteMessagePage.js index 611d5c778863..a028aa83b9e4 100644 --- a/src/pages/workspace/WorkspaceInviteMessagePage.js +++ b/src/pages/workspace/WorkspaceInviteMessagePage.js @@ -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)); } From edb1a24807633a37dab3617bad9c3777ac651ece Mon Sep 17 00:00:00 2001 From: Abdul Rahuman Date: Tue, 9 May 2023 00:18:41 +0530 Subject: [PATCH 2/4] Fixing regression of workspace name doesn't update in the message field if changed from the other platform --- src/pages/workspace/WorkspaceInviteMessagePage.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pages/workspace/WorkspaceInviteMessagePage.js b/src/pages/workspace/WorkspaceInviteMessagePage.js index a028aa83b9e4..185d3988bb98 100644 --- a/src/pages/workspace/WorkspaceInviteMessagePage.js +++ b/src/pages/workspace/WorkspaceInviteMessagePage.js @@ -81,9 +81,8 @@ class WorkspaceInviteMessagePage extends React.Component { 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; } From afec8ee0b883092549055473abc7033fd402ec31 Mon Sep 17 00:00:00 2001 From: Abdul Rahuman Date: Wed, 10 May 2023 02:10:48 +0530 Subject: [PATCH 3/4] Updating function name --- src/pages/workspace/WorkspaceInviteMessagePage.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/workspace/WorkspaceInviteMessagePage.js b/src/pages/workspace/WorkspaceInviteMessagePage.js index 185d3988bb98..cc0464f248a2 100644 --- a/src/pages/workspace/WorkspaceInviteMessagePage.js +++ b/src/pages/workspace/WorkspaceInviteMessagePage.js @@ -75,7 +75,7 @@ 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(), }; } @@ -86,10 +86,10 @@ class WorkspaceInviteMessagePage extends React.Component { ) { 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, }); From 000fbb30cdb30dc7dd97a9f26d7ef1197f9247d6 Mon Sep 17 00:00:00 2001 From: Abdul Rahuman Date: Wed, 10 May 2023 12:49:33 +0530 Subject: [PATCH 4/4] Fixing prettier --- src/pages/workspace/WorkspaceInviteMessagePage.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/workspace/WorkspaceInviteMessagePage.js b/src/pages/workspace/WorkspaceInviteMessagePage.js index b05ae66d6eb3..b5e8714f1623 100644 --- a/src/pages/workspace/WorkspaceInviteMessagePage.js +++ b/src/pages/workspace/WorkspaceInviteMessagePage.js @@ -80,8 +80,10 @@ class WorkspaceInviteMessagePage extends React.Component { componentDidUpdate(prevProps) { if ( - !((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})) + !( + (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; }