diff --git a/src/js/controllers/proposals.js b/src/js/controllers/proposals.js index 2fa6193a0..03d8492c9 100644 --- a/src/js/controllers/proposals.js +++ b/src/js/controllers/proposals.js @@ -1,22 +1,26 @@ - 'use strict'; angular.module('copayApp.controllers').controller('proposalsController', - function($timeout, $scope, profileService, $log, txpModalService) { + function($timeout, $scope, profileService, $log, txpModalService, addressbookService) { $scope.fetchingProposals = true; - $scope.$on("$ionicView.enter", function(event, data){ - profileService.getTxps(50, function(err, txps) { - $scope.fetchingProposals = false; - if (err) { - $log.error(err); - return; - } - $scope.txps = txps; - $timeout(function() { - $scope.$apply(); - }, 1); + $scope.$on("$ionicView.enter", function(event, data) { + addressbookService.list(function(err, ab) { + if (err) $log.error(err); + $scope.addressbook = ab || {}; + + profileService.getTxps(50, function(err, txps) { + $scope.fetchingProposals = false; + if (err) { + $log.error(err); + return; + } + $scope.txps = txps; + $timeout(function() { + $scope.$apply(); + }); + }); }); });