fix profile

This commit is contained in:
Matias Alejo Garcia 2014-11-30 04:03:23 -03:00
parent 1e013b1bb6
commit 436aeda1c3
3 changed files with 9 additions and 3 deletions

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('HomeController', function($scope, $rootScope, $location, notification, identityService, Compatibility) {
angular.module('copayApp.controllers').controller('HomeController', function($scope, $rootScope, $location, $timeout, notification, identityService, Compatibility) {
// This is only for backwards compat, insight api should link to #!/confirmed directly
if (getParam('confirmed')) {
var hashIndex = window.location.href.indexOf('/?');
@ -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, iden) {
$rootScope.starting = false;
if (err) {
copay.logger.warn(err);
if ((err.toString() || '').match('PNOTFOUND')) {
@ -31,7 +32,6 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
} else {
$scope.error = 'Unknown error';
}
$rootScope.$digest()
}
});
}

View File

@ -23,6 +23,12 @@ angular.module('copayApp.controllers').controller('ProfileController', function(
});
};
$scope.setWallets = function() {
if (!$rootScope.iden) return;
$scope.wallets=$rootScope.iden.listWallets();
};
$scope.downloadWalletBackup = function(w) {
if (!w) return;
backupService.walletDownload(w);

View File

@ -1,4 +1,4 @@
<div class="backup" ng-controller="ProfileController">
<div class="backup" ng-controller="ProfileController" ng-init="setWallets()">
<div class="row hide-for-large-up">
<div class="large-12 medium-12 small-12 columns">
<h1>{{$root.title}}</h1>