Fix receive and copayers views

This commit is contained in:
Gustavo Maximiliano Cortez 2016-09-29 19:52:26 -03:00
commit f57383e2cf
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
3 changed files with 31 additions and 31 deletions

View file

@ -33,31 +33,13 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.addr = null;
$scope.generatingAddress = true;
$timeout(function() {
walletService.getAddress($scope.wallet, forceNew, function(err, addr) {
$scope.generatingAddress = false;
if (err) popupService.showAlert(gettextCatalog.getString('Error'), err);
$scope.addr = addr;
if ($scope.wallet.showBackupNeededModal) $scope.openBackupNeededModal();
$scope.$apply();
});
}, 100);
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
if (!$scope.isCordova) $scope.checkTips();
$scope.wallets = profileService.getWallets();
$scope.$on('Wallet/Changed', function(event, wallet) {
if (!wallet) {
$log.debug('No wallet provided');
return;
}
$scope.wallet = wallet;
$log.debug('Wallet changed: ' + wallet.name);
$scope.setAddress();
walletService.getAddress($scope.wallet, forceNew, function(err, addr) {
$scope.generatingAddress = false;
if (err) popupService.showAlert(gettextCatalog.getString('Error'), err);
$scope.addr = addr;
if ($scope.wallet.showBackupNeededModal) $scope.openBackupNeededModal();
});
});
};
$scope.goCopayers = function() {
$ionicHistory.removeBackView();
@ -99,5 +81,23 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
from: 'tabs.receive',
walletId: $scope.wallet.credentials.walletId
});
}
};
if (!$scope.isCordova) $scope.checkTips();
$scope.$on('Wallet/Changed', function(event, wallet) {
if (!wallet) {
$log.debug('No wallet provided');
return;
}
$scope.wallet = wallet;
$log.debug('Wallet changed: ' + wallet.name);
$scope.setAddress();
$timeout(function() {
$scope.$apply();
}, 100);
});
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.wallets = profileService.getWallets();
});
});