Merge pull request #2610 from matiu/feat/join
fix error handler for join
This commit is contained in:
commit
508e784a6f
4 changed files with 11 additions and 10 deletions
|
|
@ -12,6 +12,13 @@
|
||||||
|
|
||||||
<div class="row" ng-show="!join.loading">
|
<div class="row" ng-show="!join.loading">
|
||||||
<div class="large-12 columns">
|
<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>
|
<form name="joinForm" ng-submit="join.join(joinForm)" novalidate>
|
||||||
<label><span translate>Your nickname</span>
|
<label><span translate>Your nickname</span>
|
||||||
<div class="input">
|
<div class="input">
|
||||||
|
|
|
||||||
|
|
@ -179,11 +179,6 @@ index.onGoingProcessName == 'openingWallet'
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div ng-show="!index.needsBackup || home.skipBackup">
|
<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">
|
<div class="row" ng-if="home.addr">
|
||||||
<!-- Address-->
|
<!-- Address-->
|
||||||
<div class="large-12 columns">
|
<div class="large-12 columns">
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ angular.module('copayApp.controllers').controller('joinController',
|
||||||
|
|
||||||
this.join = function(form) {
|
this.join = function(form) {
|
||||||
if (form && form.$invalid) {
|
if (form && form.$invalid) {
|
||||||
notification.error('Error', 'Please enter the required fields');
|
self.error = 'Please enter the required fields';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
self.loading = true;
|
self.loading = true;
|
||||||
|
|
@ -147,7 +147,8 @@ angular.module('copayApp.controllers').controller('joinController',
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
self.loading = false;
|
self.loading = false;
|
||||||
if (err) {
|
if (err) {
|
||||||
notification.error(err);
|
self.error = 'Could not join wallet: ' + (err.message ? err.message : err);
|
||||||
|
$rootScope.$apply();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
go.walletHome();
|
go.walletHome();
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,6 @@ angular.module('copayApp.services')
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO copayer name
|
|
||||||
root.createWallet = function(opts, cb) {
|
root.createWallet = function(opts, cb) {
|
||||||
var walletClient = bwcService.getClient();
|
var walletClient = bwcService.getClient();
|
||||||
$log.debug('Creating Wallet:', opts);
|
$log.debug('Creating Wallet:', opts);
|
||||||
|
|
@ -191,8 +190,7 @@ angular.module('copayApp.services')
|
||||||
}
|
}
|
||||||
// TODO name
|
// TODO name
|
||||||
walletClient.joinWallet(opts.secret, opts.myName || 'me', function(err) {
|
walletClient.joinWallet(opts.secret, opts.myName || 'me', function(err) {
|
||||||
// TODO: err
|
if (err) return cb(err);
|
||||||
if (err) return cb('Error joining wallet' + err);
|
|
||||||
|
|
||||||
root.profile.credentials.push(JSON.parse(walletClient.export()));
|
root.profile.credentials.push(JSON.parse(walletClient.export()));
|
||||||
root.setWalletClients();
|
root.setWalletClients();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue