diff --git a/src/account-settings/AccountSettingsPage.jsx b/src/account-settings/AccountSettingsPage.jsx
index 34858cb..8ed54bf 100644
--- a/src/account-settings/AccountSettingsPage.jsx
+++ b/src/account-settings/AccountSettingsPage.jsx
@@ -488,11 +488,11 @@ AccountSettingsPage.propTypes = {
social_link_facebook: PropTypes.string,
social_link_twitter: PropTypes.string,
time_zone: PropTypes.string,
- coaching: PropTypes.objectOf(PropTypes.shape({
- coaching_consent: PropTypes.string.isRequired,
+ coaching: PropTypes.shape({
+ coaching_consent: PropTypes.bool.isRequired,
user: PropTypes.number.isRequired,
eligible_for_coaching: PropTypes.bool.isRequired,
- })),
+ }),
}).isRequired,
siteLanguage: PropTypes.shape({
previousValue: PropTypes.string,
diff --git a/src/account-settings/coaching/CoachingConsent.jsx b/src/account-settings/coaching/CoachingConsent.jsx
index 4bb647c..0839bab 100644
--- a/src/account-settings/coaching/CoachingConsent.jsx
+++ b/src/account-settings/coaching/CoachingConsent.jsx
@@ -133,11 +133,14 @@ class CoachingConsent extends React.Component {
// !important: The order of this data matters!
// The order that this data is in, is the order that the saveSettings() function
// is called.
- this.props.saveMultipleSettings([
- {
+ const settingsSubmissions = [];
+ if (!this.props.profileDataManager) {
+ settingsSubmissions.push({
formId: 'name',
commitValues: fullName,
- },
+ });
+ }
+ Array.prototype.push.apply(settingsSubmissions, [
{
formId: 'coaching',
commitValues: {
@@ -152,6 +155,7 @@ class CoachingConsent extends React.Component {
commitValues: phoneNumber,
},
]);
+ this.props.saveMultipleSettings(settingsSubmissions);
}
async declineCoaching(e) {
@@ -181,6 +185,7 @@ class CoachingConsent extends React.Component {
formErrors={this.state.formErrors}
formValues={this.props.formValues}
redirectUrl={this.state.redirectUrl}
+ profileDataManager={this.props.profileDataManager}
/>);
case VIEWS.SUCCESS_PENDING:
return