Merge pull request #5643 from gabrielbazan7/fix/flickerAB

fix add icon flicker in addressbook view
This commit is contained in:
Javier Donadío 2017-02-21 15:44:04 -05:00 committed by GitHub
commit 5cc03497de
2 changed files with 10 additions and 6 deletions

View file

@ -3,7 +3,6 @@
angular.module('copayApp.controllers').controller('addressbookListController', function($scope, $log, $timeout, addressbookService, lodash, popupService, gettextCatalog, platformInfo) {
var contacts;
$scope.isChromeApp = platformInfo.isChromeApp;
var initAddressbook = function() {
addressbookService.list(function(err, ab) {
@ -11,6 +10,9 @@ angular.module('copayApp.controllers').controller('addressbookListController', f
$scope.isEmptyList = lodash.isEmpty(ab);
if (!$scope.isEmptyList) $scope.showAddIcon = true;
else $scope.showAddIcon = false;
contacts = [];
lodash.each(ab, function(v, k) {
contacts.push({
@ -23,7 +25,7 @@ angular.module('copayApp.controllers').controller('addressbookListController', f
$scope.addressbook = lodash.clone(contacts);
$timeout(function() {
$scope.$apply();
}, 100);
});
});
};
@ -58,6 +60,8 @@ angular.module('copayApp.controllers').controller('addressbookListController', f
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.isChromeApp = platformInfo.isChromeApp;
$scope.showAddIcon = false;
initAddressbook();
});