Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/routes/settings/helpers/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export const formatProfileSettings = (traits) => {
if (traitData && traitData.length > 0) {
data.photoUrl = traitData[0].photoURL
data.firstNLastName = `${traitData[0].firstName} ${traitData[0].lastName}`
data.country = traitData[0].country
}
}

Expand Down Expand Up @@ -114,8 +113,10 @@ export const applyProfileSettingsToTraits = (traits, profileSettings) => {
// get first and last name, if don't have should return `undefined`
const [, firstName, lastName] = profileSettings.firstNLastName ? profileSettings.firstNLastName.match(/([^\s]+)\s*(.*)/) : []
const photoURL = profileSettings.photoUrl
const country = profileSettings.country

// define country similar to connect_info if not present for basic_info
const country = _.get(trait, 'traits.data[0].country', profileSettings.country)

// update only if new values are defined
const updatedProps = _.omitBy({
photoURL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ class ProfileSettingsForm extends Component {
required
/>
</div>
{/* TODO as for now PROD doesn't supports `connect_info` we don't have a places where to save this data for now */}
{/* <div className="section-heading">Business address</div>
<div className="section-heading">Business address</div>
{this.getField('Address', 'address')}
{this.getField('City', 'city')}
<div className="field">
Expand All @@ -144,7 +143,7 @@ class ProfileSettingsForm extends Component {
onChange={this.onFieldUpdate}
/>
</div>
</div>*/}
</div>
<div className="field">
<div className="label">Country</div>
<div className="input-field">
Expand Down