Commit cefa4db658a1a2edf4bece54c052934d7a5d10a2

Authored by Caio Almeida
1 parent 2983c9ff

Do not reset badges when profile is saved

Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
www/js/controllers.js
... ... @@ -1348,7 +1348,7 @@ angular.module('confjuvapp.controllers', [])
1348 1348 badges.push(data[i]);
1349 1349 }
1350 1350 }
1351   - $scope.profile['badges'] = badges;
  1351 + $scope.profile['badges'] = $scope.badges = badges;
1352 1352 $scope.loading = false;
1353 1353 }, function(err) {
1354 1354 var popup = $ionicPopup.alert({ title: 'Meus Badges', template: 'Não foi possível carregar os badges.' });
... ... @@ -1481,6 +1481,7 @@ angular.module('confjuvapp.controllers', [])
1481 1481 $http.post(ConfJuvAppUtils.pathTo('people/' + $scope.profile.id), jQuery.param(params), config)
1482 1482 .then(function(resp) {
1483 1483 $scope.profile = resp.data.person;
  1484 + $scope.profile.badges = $scope.badges;
1484 1485 $scope.setStateAndCityOfProfile();
1485 1486 var popup = $ionicPopup.alert({ title: 'Perfil', template: 'Perfil atualizado com sucesso' });
1486 1487 popup.then(function() {
... ...