Merge pull request #153 from gabrielbazan7/feat/addEntrySend

add addressbook entry when send success
This commit is contained in:
Gustavo Maximiliano Cortez 2016-09-21 19:18:55 -03:00 committed by GitHub
commit 912789ccb6
8 changed files with 123 additions and 35 deletions

View file

@ -1,10 +1,27 @@
'use strict';
angular.module('copayApp.controllers').controller('txStatusController', function($scope, $timeout) {
angular.module('copayApp.controllers').controller('txStatusController', function($scope, $timeout, $state, $log, addressbookService) {
if ($scope.cb) $timeout($scope.cb, 100);
$scope.cancel = function() {
$scope.txStatusModal.hide();
};
$scope.save = function(addressbookEntry) {
$scope.txStatusModal.hide();
$state.go('tabs.send.addressbook', {
fromSendTab: true,
addressbookEntry: addressbookEntry
})
}
addressbookService.list(function(err, ab) {
if (err) $log.error(err);
if (ab[$scope.tx.toAddress]) {
$scope.entryExist = true;
$log.debug('Entry already exist');
}
})
});