From aa55fdd89ce068aad46403e02891027aa42d7ddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Thu, 30 Jun 2016 13:05:15 -0300 Subject: [PATCH] allow creating transaction proposal without a private key --- src/js/controllers/modals/txpDetails.js | 2 +- src/js/controllers/paperWallet.js | 2 +- src/js/controllers/walletHome.js | 16 ++++++++++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/js/controllers/modals/txpDetails.js b/src/js/controllers/modals/txpDetails.js index 42b49f5ce..855e69cd9 100644 --- a/src/js/controllers/modals/txpDetails.js +++ b/src/js/controllers/modals/txpDetails.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('txpDetailsController', function($scope, $rootScope, $timeout, $interval, platformInfo, txStatus, $ionicScrollDelegate, txFormatService, fingerprintService, bwsError, gettextCatalog, lodash, profileService, walletService) { +angular.module('copayApp.controllers').controller('txpDetailsController', function($scope, $rootScope, $timeout, $interval, $ionicModal, platformInfo, txStatus, $ionicScrollDelegate, txFormatService, fingerprintService, bwsError, gettextCatalog, lodash, profileService, walletService) { var self = $scope.self; var tx = $scope.tx; var copayers = $scope.copayers; diff --git a/src/js/controllers/paperWallet.js b/src/js/controllers/paperWallet.js index bf4c2a938..581a71b1c 100644 --- a/src/js/controllers/paperWallet.js +++ b/src/js/controllers/paperWallet.js @@ -1,5 +1,5 @@ angular.module('copayApp.controllers').controller('paperWalletController', - function($scope, $timeout, $log, configService, profileService, go, addressService, txStatus, bitcore, ongoingProcess) { + function($scope, $timeout, $log, $ionicModal, configService, profileService, go, addressService, txStatus, bitcore, ongoingProcess) { var fc = profileService.focusedClient; var rawTx; diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js index 25415b1f5..ae775f2d9 100644 --- a/src/js/controllers/walletHome.js +++ b/src/js/controllers/walletHome.js @@ -439,10 +439,18 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi if (!client.canSign() && !client.isPrivKeyExternal()) { $log.info('No signing proposal: No private key'); - self.resetForm(); - var type = txStatus.notify(createdTxp); - $scope.openStatusModal(type, createdTxp, function() { - return $scope.$emit('Local/TxProposalAction'); + ongoingProcess.set('sendingTx', true); + walletService.publishTx(client, createdTxp, function(err, publishedTxp) { + ongoingProcess.set('sendingTx', false); + if (err) { + return self.setSendError(err); + } + self.resetForm(); + go.walletHome(); + var type = txStatus.notify(createdTxp); + $scope.openStatusModal(type, createdTxp, function() { + return $scope.$emit('Local/TxProposalAction'); + }); }); } else { $rootScope.$emit('Local/NeedsConfirmation', createdTxp, function(accept) {