diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index ee0f148ae..36573dbfb 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -483,20 +483,12 @@ angular.module('copayApp.controllers').controller('confirmController', function( } }); return; - } - - if (!wallet.canSign() && !wallet.isPrivKeyExternal()) { - $log.info('No signing proposal: No private key'); - - return walletService.onlyPublish(wallet, txp, function(err, txp) { - if (err) return setSendError(err); - }); - } + } ongoingProcess.set('creatingTx', true, onSendStatusChange); createTx(wallet, false, function(err, txp) { ongoingProcess.set('creatingTx', false, onSendStatusChange); - if (err) return; + if (err) return; var config = configService.getSync(); var spendingPassEnabled = walletService.isEncrypted(wallet); @@ -539,7 +531,12 @@ angular.module('copayApp.controllers').controller('confirmController', function( function statusChangeHandler(processName, showName, isOn) { $log.debug('statusChangeHandler: ', processName, showName, isOn); - if ((processName === 'broadcastingTx' || ((processName === 'signingTx') && $scope.wallet.m > 1)) && !isOn) { + if ( + ( + processName === 'broadcastingTx' || + ((processName === 'signingTx') && $scope.wallet.m > 1) || + (processName == 'sendingTx' && !$scope.wallet.canSign() && !$scope.wallet.isPrivKeyExternal()) + ) && !isOn) { $scope.sendStatus = 'success'; $scope.$digest(); } else if (showName) { @@ -760,6 +757,15 @@ angular.module('copayApp.controllers').controller('confirmController', function( }; function publishAndSign(wallet, txp, onSendStatusChange) { + + if (!wallet.canSign() && !wallet.isPrivKeyExternal()) { + $log.info('No signing proposal: No private key'); + + return walletService.onlyPublish(wallet, txp, function(err) { + if (err) setSendError(err); + }, onSendStatusChange); + } + walletService.publishAndSign(wallet, txp, function(err, txp) { if (err) return setSendError(err); diff --git a/src/js/services/walletService.js b/src/js/services/walletService.js index da59c5ffd..c84c438df 100644 --- a/src/js/services/walletService.js +++ b/src/js/services/walletService.js @@ -889,20 +889,14 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim }; - root.onlyPublish = function(wallet, txp, cb) { - ongoingProcess.set('sendingTx', true); + root.onlyPublish = function(wallet, txp, cb, customStatusHandler) { + ongoingProcess.set('sendingTx', true, customStatusHandler); root.publishTx(wallet, txp, function(err, publishedTxp) { root.invalidateCache(wallet); - - ongoingProcess.set('sendingTx', false); - if (err) return cb(err); - - var type = root.getViewStatus(wallet, createdTxp); - root.openStatusModal(type, createdTxp, function() { - $rootScope.$emit('Local/TxAction', wallet.id); - return; - }); - return cb(null, publishedTxp); + ongoingProcess.set('sendingTx', false, customStatusHandler); + if (err) return cb(bwcError.msg(err)); + $rootScope.$emit('Local/TxAction', wallet.id); + return cb(); }); }; diff --git a/www/views/confirm.html b/www/views/confirm.html index 9af5b7664..bc686ad9c 100644 --- a/www/views/confirm.html +++ b/www/views/confirm.html @@ -137,8 +137,9 @@ slide-success-show="sendStatus === 'success'" slide-success-on-confirm="onSuccessConfirm()" slide-success-hide-on-confirm="true"> - Payment Sent - Proposal Created + Payment Sent + Proposal Created + Transaction created
A transfer has been initiated from your bank account. Your bitcoins should arrive to your wallet in 2-4 business day A transfer has been initiated to your bank account. Should arrive in 4-6 business days