fix some event handlers

This commit is contained in:
Matias Alejo Garcia 2014-12-01 15:33:16 -03:00
commit 67fd6344dd
7 changed files with 52 additions and 14 deletions

View file

@ -41,7 +41,7 @@ angular.module('copayApp.controllers').controller('CreateController',
$scope.create = function(form) {
if (form && form.$invalid) {
notification.error('Error', 'Please enter the required fields');
$scope.error = 'Please enter the required fields';
return;
}
var opts = {
@ -56,7 +56,11 @@ angular.module('copayApp.controllers').controller('CreateController',
$rootScope.starting = false;
if (err || !wallet) {
copay.logger.debug(err);
$scope.error = 'Could not create wallet.' + err;
if (err.match('OVERQUOTA')){
$scope.error = 'Could not create wallet: storage limits on remove server exceeded';
} else {
$scope.error = 'Could not create wallet: ' + err;
}
}
$rootScope.$digest()
});

View file

@ -46,11 +46,13 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
} else {
$scope.error = 'Unknown error';
}
$scope.done();
}
if (iden) {
iden.on('newWallet', $scope.done);
iden.on('noWallets', $scope.done);
iden.openWallets();
}
});
}

View file

@ -19,8 +19,9 @@ angular.module('copayApp.controllers').controller('ProfileController', function(
identityService.deleteWallet(w, function(err) {
$scope.loading = false;
if (err) {
log.warn(err);
copay.logger.warn(err);
}
$scope.setWallets();
});
};