Auto update tx-details
This commit is contained in:
parent
8d2a30e2ad
commit
1454d1afdf
2 changed files with 18 additions and 8 deletions
|
|
@ -1,8 +1,9 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('txDetailsController', function($log, $ionicHistory, $scope, $timeout, walletService, lodash, gettextCatalog, profileService, configService, externalLinkService, popupService, ongoingProcess, txFormatService) {
|
||||
angular.module('copayApp.controllers').controller('txDetailsController', function($rootScope, $log, $ionicHistory, $scope, $timeout, walletService, lodash, gettextCatalog, profileService, configService, externalLinkService, popupService, ongoingProcess, txFormatService) {
|
||||
|
||||
var txId;
|
||||
var listeners = [];
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
txId = data.stateParams.txid;
|
||||
|
|
@ -11,7 +12,21 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
|
|||
$scope.color = $scope.wallet.color;
|
||||
$scope.copayerId = $scope.wallet.credentials.copayerId;
|
||||
$scope.isShared = $scope.wallet.credentials.n > 1;
|
||||
$scope.updateTx();
|
||||
updateTx();
|
||||
|
||||
listeners = [
|
||||
$rootScope.$on('bwsEvent', function(e, walletId, type, n) {
|
||||
if (type == 'NewBlock' && n && n.data && n.data.network == 'livenet') {
|
||||
updateTx();
|
||||
}
|
||||
})
|
||||
];
|
||||
});
|
||||
|
||||
$scope.$on("$ionicView.leave", function(event, data) {
|
||||
lodash.each(listeners, function(x) {
|
||||
x();
|
||||
});
|
||||
});
|
||||
|
||||
function getDisplayAmount(amountStr) {
|
||||
|
|
@ -73,7 +88,7 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
|
|||
}, 10);
|
||||
}
|
||||
|
||||
$scope.updateTx = function() {
|
||||
var updateTx = function() {
|
||||
ongoingProcess.set('loadingTxInfo', true);
|
||||
walletService.getTx($scope.wallet, txId, function(err, tx) {
|
||||
ongoingProcess.set('loadingTxInfo', false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue