Clean code. Fix coinbase tx modal
This commit is contained in:
parent
a776c19e60
commit
9ac1e565ac
5 changed files with 77 additions and 62 deletions
|
|
@ -1,18 +1,28 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('coinbaseTxDetailsController', function($scope, $rootScope, coinbaseService) {
|
||||
angular.module('copayApp.controllers').controller('coinbaseTxDetailsController', function($scope, coinbaseService, popupService) {
|
||||
|
||||
$scope.remove = function() {
|
||||
coinbaseService.savePendingTransaction($scope.tx, {
|
||||
remove: true
|
||||
}, function(err) {
|
||||
$rootScope.$emit('Local/CoinbaseTx');
|
||||
$scope.close();
|
||||
coinbaseService.setCredentials();
|
||||
$scope.updateRequired = false;
|
||||
var message = 'Are you sure you want to remove this transaction?';
|
||||
popupService.showConfirm(null, message, null, null, function(ok) {
|
||||
if (!ok) {
|
||||
return;
|
||||
}
|
||||
coinbaseService.savePendingTransaction($scope.tx, {
|
||||
remove: true
|
||||
}, function(err) {
|
||||
$scope.updateRequired = true;
|
||||
$scope.close();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$scope.close = function() {
|
||||
$scope.coinbaseTxDetailsModal.hide();
|
||||
$scope.modal.hide().then(function() {
|
||||
if ($scope.updateRequired) $scope.updateTransactions();
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue