controllers refactor to handle identities

This commit is contained in:
Matias Alejo Garcia 2014-10-08 10:54:26 -03:00
commit 0b7e9be611
14 changed files with 190 additions and 227 deletions

View file

@ -57,6 +57,8 @@ angular.module('copayApp.controllers').controller('SidebarController', function(
return new Array(num);
}
if ($rootScope.wallet) {
$scope.$on('$idleWarn', function(a, countdown) {
if (!(countdown % 5))
@ -72,18 +74,7 @@ angular.module('copayApp.controllers').controller('SidebarController', function(
});
}
$scope.switchWallet = function(id) {
var iden = $rootScope.iden;
controllerUtils.unbindWallet($scope);
iden.openWallet(id, null, function(err, w) {
if (err) {
notification.warning('Could not open wallet');
} else {
$scope.loading = false;
$rootScope.wallet = w;
controllerUtils.bindWallet(w, $scope);
}
});
$scope.switchWallet = function(wid) {
controllerUtils.setFocusedWallet(wid);
};
});