mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
fix undefined last name
This commit is contained in:
parent
2ebd972603
commit
193d497d66
2 changed files with 4 additions and 4 deletions
|
@ -35,8 +35,8 @@ module.exports = ContactsController =
|
||||||
_formatContact: (contact) ->
|
_formatContact: (contact) ->
|
||||||
return {
|
return {
|
||||||
id: contact._id?.toString()
|
id: contact._id?.toString()
|
||||||
email: contact.email
|
email: contact.email || ""
|
||||||
first_name: contact.first_name
|
first_name: contact.first_name || ""
|
||||||
last_name: contact.last_name
|
last_name: contact.last_name || ""
|
||||||
type: "user"
|
type: "user"
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ define [
|
||||||
$scope.autocompleteContacts = data.contacts or []
|
$scope.autocompleteContacts = data.contacts or []
|
||||||
for contact in $scope.autocompleteContacts
|
for contact in $scope.autocompleteContacts
|
||||||
if contact.type == "user"
|
if contact.type == "user"
|
||||||
if contact.last_name == "" and contact.first_name == contact.email.split("@")[0]
|
if contact.first_name == contact.email.split("@")[0] and !contact.last_name
|
||||||
# User has not set their proper name so use email as canonical display property
|
# User has not set their proper name so use email as canonical display property
|
||||||
contact.display = contact.email
|
contact.display = contact.email
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue