diff --git a/js/controllers/homeWallet.js b/js/controllers/homeWallet.js index a4efbe719..ec102f953 100644 --- a/js/controllers/homeWallet.js +++ b/js/controllers/homeWallet.js @@ -5,43 +5,63 @@ angular.module('copayApp.controllers').controller('HomeWalletController', functi $scope.openTxModal = function(tx) { var ModalInstanceCtrl = function($scope, $modalInstance) { var w = $rootScope.wallet; + $scope.error = null; $scope.tx = tx; + $scope.registeredCopayerIds = w.getRegisteredCopayerIds(); $scope.loading = null; + $scope.getShortNetworkName = function() { + var w = $rootScope.wallet; + return w.getNetworkName().substring(0, 4); + }; + $scope.sign = function(ntxid) { $scope.loading = true; + $scope.error = null; $timeout(function() { w.signAndSend(ntxid, function(err, id, status) { $scope.loading = false; - if (err) - $scope.error = err; - else - $modalInstance.close(status); + if (err) { + $scope.error = 'Transaction could not send. Please try again.'; + $scope.$digest(); + } + else { + $modalInstance.close(status); + } }); }, 100); }; $scope.reject = function(ntxid) { $scope.loading = true; + $scope.error = null; $timeout(function() { w.reject(ntxid, function(err, status) { $scope.loading = false; - if (err) - $scope.error = err; - else - $modalInstance.close(status); + if (err) { + $scope.error = err; + $scope.$digest(); + } + else { + $modalInstance.close(status); + } }); }, 100); }; $scope.broadcast = function(ntxid) { $scope.loading = true; + $scope.error = null; $timeout(function() { w.issueTx(ntxid, function(err, txid, status) { $scope.loading = false; - if (err) - $scope.error = err; - $modalInstance.close(status); + if (err) { + $scope.error = 'Transaction could not send. Please try again.'; + $scope.$digest(); + } + else { + $modalInstance.close(status); + } }); }, 100); }; diff --git a/views/modals/tx-details.html b/views/modals/tx-details.html index 45ae1c5ab..848f795c6 100644 --- a/views/modals/tx-details.html +++ b/views/modals/tx-details.html @@ -73,7 +73,7 @@ ID: {{btx.txid}}
- + See it on the blockchain
diff --git a/views/modals/txp-details.html b/views/modals/txp-details.html index e9c2013cc..3b6ccca2e 100644 --- a/views/modals/txp-details.html +++ b/views/modals/txp-details.html @@ -57,16 +57,19 @@
Signatures:
@@ -78,14 +81,14 @@ {{error}} - × -
+ ng-show="!tx.signedBy[$root.wallet.getMyCopayerId()] && !tx.rejectedBy[$root.wallet.getMyCopayerId()] && + $root.wallet.txProposals.txps[tx.ntxid].builder.build().countInputMissingSignatures(0) != 0">
-
-
-
- +
+
+ +
+
+ + See it on the blockchain + +
Transaction sent!
+
+
+ Transaction finally rejected +