Browse Source

Fixed DELETED user when searching

master
Igor Zhukov 10 years ago
parent
commit
fe711d9432
  1. 2
      app/js/controllers.js
  2. 5
      app/js/services.js

2
app/js/controllers.js

@ -1862,7 +1862,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) @@ -1862,7 +1862,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
userFullResult.user.first_name = $scope.override.first_name;
userFullResult.user.last_name = $scope.override.last_name;
}
AppUsersManager.saveApiUser(userFullResult.user);
AppUsersManager.saveApiUser(userFullResult.user, true);
AppPhotosManager.savePhoto(userFullResult.profile_photo);
if (userFullResult.profile_photo._ != 'photoEmpty') {
$scope.userPhoto.id = userFullResult.profile_photo.id;

5
app/js/services.js

@ -77,8 +77,9 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -77,8 +77,9 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
angular.forEach(apiUsers, saveApiUser);
};
function saveApiUser (apiUser) {
if (!angular.isObject(apiUser)) {
function saveApiUser (apiUser, noReplace) {
if (!angular.isObject(apiUser) ||
noReplace && angular.isObject(users[apiUser.id]) && users[apiUser.id].first_name) {
return;
}

Loading…
Cancel
Save