add addressbook entry when send success

This commit is contained in:
Gabriel Bazán 2016-09-21 15:13:22 -03:00
commit ef90113dd8
9 changed files with 126 additions and 37 deletions

View file

@ -83,7 +83,8 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
$scope.showCommentPopup = function() {
popupService.showPrompt(gettextCatalog.getString('Memo'), ' ', {}, function(text) {
$log.debug('Saving memo');
console.log("#######################");
console.log(text);
var args = {
txid: $scope.btx.txid,
body: text

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');
}
})
});