Merge pull request #5226 from JDonadio/fix/proposal-view

Use contact name in proposal card
This commit is contained in:
Gustavo Maximiliano Cortez 2016-12-14 16:28:22 -03:00 committed by GitHub
commit 80346f20e7
2 changed files with 29 additions and 13 deletions

View file

@ -1,24 +1,34 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('proposalsController', angular.module('copayApp.controllers').controller('proposalsController',
function($timeout, $scope, profileService, $log, txpModalService) { function($timeout, $scope, profileService, $log, txpModalService, addressbookService) {
$scope.fetchingProposals = true; $scope.fetchingProposals = true;
$scope.$on("$ionicView.enter", function(event, data){ $scope.$on("$ionicView.enter", function(event, data) {
profileService.getTxps(50, function(err, txps) { addressbookService.list(function(err, ab) {
$scope.fetchingProposals = false; if (err) $log.error(err);
if (err) { $scope.addressbook = ab || {};
$log.error(err);
return; profileService.getTxps(50, function(err, txps) {
} $scope.fetchingProposals = false;
$scope.txps = txps; if (err) {
$timeout(function() { $log.error(err);
$scope.$apply(); return;
}, 1); }
$scope.txps = txps;
$timeout(function() {
$scope.$apply();
});
});
}); });
}); });
$scope.openTxpModal = txpModalService.open; $scope.openTxpModal = txpModalService.open;
$scope.createdWithinPastDay = function(time) {
var now = new Date();
var date = new Date(time * 1000);
return (now.getTime() - date.getTime()) < (1000 * 60 * 60 * 24);
};
}); });

View file

@ -126,6 +126,12 @@ angular.module('copayApp.controllers').controller('tabHomeController',
}); });
}); });
$scope.createdWithinPastDay = function(time) {
var now = new Date();
var date = new Date(time * 1000);
return (now.getTime() - date.getTime()) < (1000 * 60 * 60 * 24);
};
$scope.openExternalLink = function() { $scope.openExternalLink = function() {
var url = 'https://github.com/bitpay/copay/releases/latest'; var url = 'https://github.com/bitpay/copay/releases/latest';
var optIn = true; var optIn = true;