Merge pull request #2610 from matiu/feat/join

fix error handler for join
This commit is contained in:
Gustavo Maximiliano Cortez 2015-04-24 03:48:47 -03:00
commit 508e784a6f
4 changed files with 11 additions and 10 deletions

View File

@ -12,6 +12,13 @@
<div class="row" ng-show="!join.loading">
<div class="large-12 columns">
<div class="box-notification" ng-show="join.error ">
<span class="text-warning size-14">
{{join.error|translate}}
</span>
</div>
<form name="joinForm" ng-submit="join.join(joinForm)" novalidate>
<label><span translate>Your nickname</span>
<div class="input">

View File

@ -179,11 +179,6 @@ index.onGoingProcessName == 'openingWallet'
</div>
</div>
<div ng-show="!index.needsBackup || home.skipBackup">
<div class="box-notification" ng-show="home.error ">
<span class="text-warning size-14">
{{home.error|translate}}
</span>
</div>
<div class="row" ng-if="home.addr">
<!-- Address-->
<div class="large-12 columns">

View File

@ -134,7 +134,7 @@ angular.module('copayApp.controllers').controller('joinController',
this.join = function(form) {
if (form && form.$invalid) {
notification.error('Error', 'Please enter the required fields');
self.error = 'Please enter the required fields';
return;
}
self.loading = true;
@ -147,7 +147,8 @@ angular.module('copayApp.controllers').controller('joinController',
}, function(err) {
self.loading = false;
if (err) {
notification.error(err);
self.error = 'Could not join wallet: ' + (err.message ? err.message : err);
$rootScope.$apply();
}
else {
go.walletHome();

View File

@ -151,7 +151,6 @@ angular.module('copayApp.services')
})
};
// TODO copayer name
root.createWallet = function(opts, cb) {
var walletClient = bwcService.getClient();
$log.debug('Creating Wallet:', opts);
@ -191,8 +190,7 @@ angular.module('copayApp.services')
}
// TODO name
walletClient.joinWallet(opts.secret, opts.myName || 'me', function(err) {
// TODO: err
if (err) return cb('Error joining wallet' + err);
if (err) return cb(err);
root.profile.credentials.push(JSON.parse(walletClient.export()));
root.setWalletClients();