working with events
This commit is contained in:
parent
3ae6378678
commit
494c21132a
4 changed files with 26 additions and 10 deletions
|
|
@ -24,6 +24,7 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
|
|||
}
|
||||
$rootScope.starting = true;
|
||||
identityService.open(form.email.$modelValue, form.password.$modelValue, function(err) {
|
||||
console.log('[home.js.27]'); //TODO
|
||||
$rootScope.starting = false;
|
||||
if (err) {
|
||||
copay.logger.warn(err);
|
||||
|
|
|
|||
|
|
@ -44,14 +44,30 @@ angular.module('copayApp.controllers').controller('SidebarController', function(
|
|||
|
||||
|
||||
$scope.init = function() {
|
||||
|
||||
// Change focused wallet
|
||||
if ($rootScope.wallet) {
|
||||
$rootScope.$watch('wallet', function() {
|
||||
$scope.walletSelection = false;
|
||||
$scope.setWallets();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// Change wallet list
|
||||
if ($rootScope.iden) {
|
||||
var iden = $rootScope.iden;
|
||||
iden.on('newWallet', function() {
|
||||
$scope.walletSelection = false;
|
||||
$scope.setWallets();
|
||||
});
|
||||
iden.on('deleteWallet', function() {
|
||||
$scope.walletSelection = false;
|
||||
$scope.setWallets();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$scope.setWallets = function() {
|
||||
if (!$rootScope.iden) return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue