From cefa4db658a1a2edf4bece54c052934d7a5d10a2 Mon Sep 17 00:00:00 2001 From: Caio SBA Date: Tue, 20 Oct 2015 10:46:36 -0300 Subject: [PATCH] Do not reset badges when profile is saved --- www/js/controllers.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/js/controllers.js b/www/js/controllers.js index 5cec624..8845a37 100644 --- a/www/js/controllers.js +++ b/www/js/controllers.js @@ -1348,7 +1348,7 @@ angular.module('confjuvapp.controllers', []) badges.push(data[i]); } } - $scope.profile['badges'] = badges; + $scope.profile['badges'] = $scope.badges = badges; $scope.loading = false; }, function(err) { var popup = $ionicPopup.alert({ title: 'Meus Badges', template: 'Não foi possível carregar os badges.' }); @@ -1481,6 +1481,7 @@ angular.module('confjuvapp.controllers', []) $http.post(ConfJuvAppUtils.pathTo('people/' + $scope.profile.id), jQuery.param(params), config) .then(function(resp) { $scope.profile = resp.data.person; + $scope.profile.badges = $scope.badges; $scope.setStateAndCityOfProfile(); var popup = $ionicPopup.alert({ title: 'Perfil', template: 'Perfil atualizado com sucesso' }); popup.then(function() { -- libgit2 0.21.2