Account for update_user not having a full_name field.

Going forward, the back end may supply fields other than
full_name, like is_admin, so we should make sure the field
is in the hash first.

(imported from commit be94b9698bae0866444739e2846ff65a3ab27eb6)
This commit is contained in:
Steve Howell 2014-01-21 17:04:56 -05:00
parent 93deefec8d
commit 81d975c5ff
1 changed files with 9 additions and 7 deletions

View File

@ -90,15 +90,17 @@ function update_person(person) {
}
var person_obj = people_dict.get(person.email);
if (people_by_name_dict.has(person_obj.full_name)) {
people_by_name_dict.set(person.full_name, person_obj);
people_by_name_dict.del(person_obj.full_name);
}
if (_.has(person, 'full_name')) {
if (people_by_name_dict.has(person_obj.full_name)) {
people_by_name_dict.set(person.full_name, person_obj);
people_by_name_dict.del(person_obj.full_name);
}
person_obj.full_name = person.full_name;
person_obj.full_name = person.full_name;
if (person.email === page_params.email) {
page_params.fullname = person.full_name;
if (person.email === page_params.email) {
page_params.fullname = person.full_name;
}
}
activity.set_user_statuses([]);