Merge pull request #6100 from cmgustavo/feat/tx-confirm-notification-02

Notify when a tx has been confirmed
This commit is contained in:
Gabriel Edgardo Bazán 2017-05-29 14:01:00 -03:00 committed by GitHub
commit 5f39c45d61
6 changed files with 74 additions and 2 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('txDetailsController', function($rootScope, $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, externalLinkService, popupService, ongoingProcess, txFormatService, txConfirmNotification) {
var txId;
var listeners = [];
@ -12,6 +12,10 @@ 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;
txConfirmNotification.checkIfEnabled(txId, function(res) {
$scope.txNotification = { value: res };
});
});
$scope.$on("$ionicView.afterEnter", function(event) {
@ -188,4 +192,12 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
});
};
$scope.txConfirmNotificationChange = function() {
if ($scope.txNotification.value) {
txConfirmNotification.subscribe($scope.wallet, { txid: txId });
} else {
txConfirmNotification.unsubscribe($scope.wallet, txId);
}
};
});