mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #2610 from matiu/feat/join
fix error handler for join
This commit is contained in:
commit
508e784a6f
|
@ -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">
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue