better tx create at confirm

This commit is contained in:
Matias Alejo Garcia 2016-09-02 14:17:47 -03:00
commit d7e025c2d0
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
7 changed files with 34 additions and 29 deletions

View file

@ -32,12 +32,9 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
$scope.sign = function() {
$scope.loading = true;
walletService.publishAndSign($scope.wallet, $scope.tx, function(err, txp) {
console.log('[txpDetails.js.35] AFTER publush'); //TODO
$scope.$emit('UpdateTx');
if (err) return setSendError(err);
$scope.close(txp);
$scope.close(true);
});
};
@ -53,7 +50,7 @@ console.log('[txpDetails.js.35] AFTER publush'); //TODO
if (err)
return setError(err, gettextCatalog.getString('Could not reject payment'));
$scope.close(txpr);
$scope.close(true);
});
@ -73,7 +70,7 @@ console.log('[txpDetails.js.35] AFTER publush'); //TODO
return setError(err, gettextCatalog.getString('Could not delete payment proposal'));
}
$scope.close();
$scope.close(true);
});
}, 10);
};
@ -90,7 +87,7 @@ console.log('[txpDetails.js.35] AFTER publush'); //TODO
return setError(err, gettextCatalog.getString('Could not broadcast payment'));
}
$scope.close(txpb);
$scope.close(true);
});
}, 10);
};
@ -175,7 +172,10 @@ console.log('[txpDetails.js.35] AFTER publush'); //TODO
});
};
$scope.close = function(txp) {
$scope.close = function(shouldEmit) {
if (shouldEmit)
$rootScope.$emit('Local/TxAction', $scope.wallet.id);
$scope.loading = null;
$scope.txpDetailsModal.hide();
};