Skip to content

Commit

Permalink
Merge pull request #11371 from tienifr/fix/11157-Unable-to-save-first…
Browse files Browse the repository at this point in the history
…-name-last-name-and-time-zone-when-user-is-offline

fix/11157 Unable to save first name, last name and time zone when user is offline
  • Loading branch information
Julesssss authored Oct 5, 2022
2 parents 1a42cf8 + d95cec7 commit f710d78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ const propTypes = {
// eslint-disable-next-line react/forbid-prop-types
draftValues: PropTypes.object,

/** Should the button be enabled when offline */
enabledWhenOffline: PropTypes.bool,

...withLocalizePropTypes,
};

Expand All @@ -54,6 +57,7 @@ const defaultProps = {
errors: null,
},
draftValues: {},
enabledWhenOffline: false,
};

class Form extends React.Component {
Expand Down Expand Up @@ -205,6 +209,7 @@ class Form extends React.Component {
this.inputRefs[_.first(_.keys(this.state.errors))].focus();
}}
containerStyles={[styles.mh0, styles.mt5]}
enabledWhenOffline={this.props.enabledWhenOffline}
/>
)}
</View>
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/Profile/ProfilePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ class ProfilePage extends Component {
validate={this.validate}
onSubmit={this.updatePersonalDetails}
submitButtonText={this.props.translate('common.save')}
enabledWhenOffline
>
<OfflineWithFeedback
pendingAction={lodashGet(this.props.currentUserPersonalDetails, 'pendingFields.avatar', null)}
Expand Down

0 comments on commit f710d78

Please sign in to comment.