diff --git a/public/views/modals/tx-details.html b/public/views/modals/tx-details.html index a0f3571c8..79e7f5be9 100644 --- a/public/views/modals/tx-details.html +++ b/public/views/modals/tx-details.html @@ -1,5 +1,5 @@ - + {{'Close' | translate}} @@ -9,10 +9,10 @@ - + - + @@ -30,30 +30,30 @@ - - Sent from {{wallet.credentials.walletName}} - - - + + Sent from {{wallet.credentials.walletName}} + + + - - - - - Received Funds + + + + Received Funds + - - Moved Funds - + + Moved Funds + - - + @@ -75,14 +75,22 @@ - Created by - {{btx.creatorName}} - - {{ btx.createdOn * 1000 | amDateFormat:'MM/DD/YYYY HH:mm a'}} - + + Date + + {{ btx.time * 1000 | amDateFormat:'MM/DD/YYYY HH:mm a'}} + + + + Created by + {{btx.creatorName}} + + {{ btx.createdOn * 1000 | amDateFormat:'MM/DD/YYYY HH:mm a'}} + + - + Fee {{btx.feeLevel}} ({{btx.feeStr}}) diff --git a/src/js/controllers/modals/txDetails.js b/src/js/controllers/modals/txDetails.js index b6c2f3f32..b7c142edb 100644 --- a/src/js/controllers/modals/txDetails.js +++ b/src/js/controllers/modals/txDetails.js @@ -1,26 +1,37 @@ 'use strict'; -angular.module('copayApp.controllers').controller('txDetailsController', function($log, $timeout, $scope, $filter, $stateParams, walletService, lodash, gettextCatalog, profileService, configService, txFormatService, externalLinkService, popupService) { +angular.module('copayApp.controllers').controller('txDetailsController', function($log, $timeout, $scope, $filter, $stateParams, ongoingProcess, walletService, lodash, gettextCatalog, profileService, configService, txFormatService, externalLinkService, popupService) { var self = $scope.self; var wallet = profileService.getWallet($stateParams.walletId || $scope.walletId); var config = configService.getSync(); var configWallet = config.wallet; var walletSettings = configWallet.settings; + $scope.title = gettextCatalog.getString('Transaction'); + $scope.loadingTxInfo = false; $scope.init = function() { + $scope.loadingTxInfo = true; + ongoingProcess.set('loadingTxInfo', true); findTx($scope.txid, function(err, tx) { + ongoingProcess.set('loadingTxInfo', false); + $scope.loadingTxInfo = false; if (err) { $log.error(err); - return; + popupService.showAlert(gettextCatalog.getString('Error'), err); + return $scope.cancel(); } - console.log('TX FOUND', tx); + + if (!tx) { + $log.warn('No tx found'); + popupService.showAlert(gettextCatalog.getString('Transaction not found'), null); + return $scope.cancel(); + } + $scope.btx = lodash.cloneDeep(tx); $scope.alternativeIsoCode = walletSettings.alternativeIsoCode; $scope.color = wallet.color; $scope.copayerId = wallet.credentials.copayerId; $scope.isShared = wallet.credentials.n > 1; - // $scope.btx.amountStr = txFormatService.formatAmount($scope.btx.amount, true) + ' ' + walletSettings.unitName; - // $scope.btx.feeStr = txFormatService.formatAmount($scope.btx.fees, true) + ' ' + walletSettings.unitName; $scope.btx.feeLevel = walletSettings.feeLevel; if ($scope.btx.action != 'invalid') { @@ -46,8 +57,7 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio txid: txid }); - if (tx) return cb(null, tx); - else return cb(); + return cb(null, tx); }); }; @@ -148,5 +158,8 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio $scope.cancel = function() { $scope.txDetailsModal.hide(); + $timeout(function() { + $scope.txDetailsModal.remove(); + }, 10); }; }); diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index 0efcbaddf..605c67ee3 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -17,7 +17,6 @@ angular.module('copayApp.controllers').controller('tabHomeController', }); $scope.openTxModal = function(n) { - console.log(n); $scope.txid = n.txid; $scope.walletId = n.walletId; $ionicModal.fromTemplateUrl('views/modals/tx-details.html', { diff --git a/src/js/services/onGoingProcess.js b/src/js/services/onGoingProcess.js index be1d5ee70..642051951 100644 --- a/src/js/services/onGoingProcess.js +++ b/src/js/services/onGoingProcess.js @@ -32,6 +32,7 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti 'sweepingWallet': gettext('Sweeping Wallet...'), 'validatingWallet': gettext('Validating wallet integrity...'), 'validatingWords': gettext('Validating recovery phrase...'), + 'loadingTxInfo': gettext('Loading transaction info...'), }; root.clear = function() {