Merge pull request #5583 from JDonadio/bug/delete-wallet-02

Update scope after delete wallet - receive tab
This commit is contained in:
Gustavo Maximiliano Cortez 2017-02-16 11:58:56 -03:00 committed by GitHub
commit fc07571811
1 changed files with 7 additions and 3 deletions

View File

@ -21,7 +21,7 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
walletService.getAddress($scope.wallet, forceNew, function(err, addr) { walletService.getAddress($scope.wallet, forceNew, function(err, addr) {
$scope.generatingAddress = false; $scope.generatingAddress = false;
if (err) { if (err) {
//Error is already formated //Error is already formated
return popupService.showAlert(err); return popupService.showAlert(err);
} }
@ -152,7 +152,6 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.loadAddresses(wallet); $scope.loadAddresses(wallet);
}); });
listeners = [ listeners = [
$rootScope.$on('bwsEvent', function(e, walletId, type, n) { $rootScope.$on('bwsEvent', function(e, walletId, type, n) {
// Update current address // Update current address
@ -161,7 +160,12 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
]; ];
// Update current wallet // Update current wallet
if ($scope.wallet) $scope.updateCurrentWallet(); if ($scope.wallet) {
var w = lodash.find($scope.wallets, function(w) {
return w.id == $scope.wallet.id;
});
if (w) $scope.updateCurrentWallet();
}
}); });
$scope.$on("$ionicView.leave", function(event, data) { $scope.$on("$ionicView.leave", function(event, data) {