This commit is contained in:
Matias Alejo Garcia 2016-08-18 11:45:30 -03:00
commit 02c8cb44d6
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
10 changed files with 57 additions and 56 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('txDetailsController', function($rootScope, $log, $scope, $filter, $ionicPopup, gettextCatalog, profileService, configService, lodash) {
angular.module('copayApp.controllers').controller('txDetailsController', function($rootScope, $log, $scope, $filter, $ionicPopup, gettextCatalog, profileService, configService, lodash, txFormatService) {
var self = $scope.self;
var fc = profileService.focusedClient;
@ -13,8 +13,8 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
$scope.copayerId = fc.credentials.copayerId;
$scope.isShared = fc.credentials.n > 1;
$scope.btx.amountStr = profileService.formatAmount($scope.btx.amount, true) + ' ' + walletSettings.unitName;
$scope.btx.feeStr = profileService.formatAmount($scope.btx.fees, true) + ' ' + walletSettings.unitName;
$scope.btx.amountStr = txFormatService.formatAmount($scope.btx.amount, true) + ' ' + walletSettings.unitName;
$scope.btx.feeStr = txFormatService.formatAmount($scope.btx.fees, true) + ' ' + walletSettings.unitName;
$scope.showCommentPopup = function() {
$scope.data = {

View file

@ -108,12 +108,12 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
};
$scope.getShortNetworkName = function() {
return fc.credentials.networkName.substring(0, 4);
return $scope.wallet.credentials.networkName.substring(0, 4);
};
function checkPaypro() {
if (tx.payProUrl && !platformInfo.isChromeApp) {
fc.fetchPayPro({
$scope.wallet.fetchPayPro({
payProUrl: tx.payProUrl,
}, function(err, paypro) {
if (err) return;
@ -150,7 +150,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
lodash.each(['TxProposalRejectedBy', 'TxProposalAcceptedBy', 'transactionProposalRemoved', 'TxProposalRemoved', 'NewOutgoingTx', 'UpdateTx'], function(eventName) {
$rootScope.$on(eventName, function() {
fc.getTx($scope.tx.id, function(err, tx) {
$scope.wallet.getTx($scope.tx.id, function(err, tx) {
if (err) {
if (err.message && err.message == 'TX_NOT_FOUND' &&
(eventName == 'transactionProposalRemoved' || eventName == 'TxProposalRemoved')) {
@ -163,7 +163,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
}
var action = lodash.find(tx.actions, {
copayerId: fc.credentials.copayerId
copayerId: $scope.wallet.credentials.copayerId
});
$scope.tx = txFormatService.processTx(tx);
@ -187,14 +187,6 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
});
};
function handleEncryptedWallet(cb) {
if (!walletService.isEncrypted(fc)) return cb();
$rootScope.$emit('Local/NeedsPassword', false, function(err, password) {
if (err) return cb(err);
return cb(walletService.unlock(fc, password));
});
};
$scope.copyToClipboard = function(addr, $event) {
if (!addr) return;
self.copyToClipboard(addr, $event);