destroy listener on copayers view

This commit is contained in:
Gabriel Bazán 2017-05-17 16:03:16 -03:00
parent eb945b4589
commit 470cf23999
1 changed files with 5 additions and 1 deletions

View File

@ -12,10 +12,14 @@ angular.module('copayApp.controllers').controller('copayersController',
updateWallet();
});
$rootScope.$on('bwsEvent', function() {
var listener = $rootScope.$on('bwsEvent', function() {
updateWallet();
});
$scope.$on('$destroy', function() {
listener();
});
var updateWallet = function() {
$log.debug('Updating wallet:' + $scope.wallet.name)
walletService.getStatus($scope.wallet, {}, function(err, status) {