From 7df66227dfdd3b3d63bbbbda6a00ce036941f7e1 Mon Sep 17 00:00:00 2001 From: tienifr Date: Wed, 18 Oct 2023 15:08:42 +0700 Subject: [PATCH 1/2] fix: 27902 --- src/pages/workspace/WorkspaceInviteMessagePage.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceInviteMessagePage.js b/src/pages/workspace/WorkspaceInviteMessagePage.js index 5e7efadd3778..f59cab53bca8 100644 --- a/src/pages/workspace/WorkspaceInviteMessagePage.js +++ b/src/pages/workspace/WorkspaceInviteMessagePage.js @@ -76,7 +76,7 @@ class WorkspaceInviteMessagePage extends React.Component { this.validate = this.validate.bind(this); this.openPrivacyURL = this.openPrivacyURL.bind(this); this.state = { - welcomeNote: this.getDefaultWelcomeNote(), + welcomeNote: this.props.savedWelcomeMessage || this.getDefaultWelcomeNote(), }; } @@ -228,6 +228,7 @@ class WorkspaceInviteMessagePage extends React.Component { defaultValue={this.state.welcomeNote} value={this.state.welcomeNote} onChangeText={(text) => this.setState({welcomeNote: text})} + shouldSaveDraft /> @@ -250,6 +251,10 @@ export default compose( invitedEmailsToAccountIDsDraft: { key: ({route}) => `${ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MEMBERS_DRAFT}${route.params.policyID.toString()}`, }, + savedWelcomeMessage: { + key: `${ONYXKEYS.FORMS.WORKSPACE_INVITE_MESSAGE_FORM}Draft`, + selector: (draft) => draft ? draft.welcomeMessage : '' + } }), withNavigationFocus, )(WorkspaceInviteMessagePage); From 00b83aa50421c8f9d974697f96b7e020e0055c1a Mon Sep 17 00:00:00 2001 From: tienifr Date: Mon, 30 Oct 2023 15:15:41 +0700 Subject: [PATCH 2/2] merge main --- src/pages/workspace/WorkspaceInviteMessagePage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/workspace/WorkspaceInviteMessagePage.js b/src/pages/workspace/WorkspaceInviteMessagePage.js index 5599fd3ada5d..bab9e526ace5 100644 --- a/src/pages/workspace/WorkspaceInviteMessagePage.js +++ b/src/pages/workspace/WorkspaceInviteMessagePage.js @@ -254,8 +254,8 @@ export default compose( }, savedWelcomeMessage: { key: `${ONYXKEYS.FORMS.WORKSPACE_INVITE_MESSAGE_FORM}Draft`, - selector: (draft) => draft ? draft.welcomeMessage : '' - } + selector: (draft) => (draft ? draft.welcomeMessage : ''), + }, }), withNavigationFocus, )(WorkspaceInviteMessagePage);