Eliminating working when user was just created

This commit is contained in:
Luis Fernando Molina committed 2018-09-14 12:00:29 +02:00
1 parent 2e4a552cc4
commit 6bebe65fd3
1 file changed
+9
+9
View File
@@ -237,6 +237,15 @@ class UserUpdate extends Component {
let user = JSON.parse(userData)
this.defaultValuesSet = true
/* To avoid console warning, we need to take care of the fields that are null. */
if (user.firstName === null) { user.firstName = '' }
if (user.middleName === null) { user.middleName = '' }
if (user.lastName === null) { user.lastName = '' }
if (user.bio === null) { user.bio = '' }
/* Now we are ready to set the initial state. */
this.setState({
id: user.id,
alias: user.alias,