add bws settings in create wallet->advanced options
This commit is contained in:
parent
bd53b9dde5
commit
3d6b393e7c
2 changed files with 23 additions and 9 deletions
|
|
@ -132,10 +132,9 @@
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label for="bws" class="oh">
|
<label for="bws" class="oh">
|
||||||
<span translate>Specify Bitcore Wallet Service
|
<span translate>Specify Bitcore Wallet Service URL
|
||||||
<i class="icon-arrow-right3 size-24 right"></i>
|
<input type="text" id="bwsurl" type="text" name="bwsurl" ng-model="bwsurl">
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label for="createPassphrase" class="line-b oh" ng-hide="setSeed || hwLedger || hwTrezor" ><span translate>Add a Seed Passphrase</span> <small translate>Add an optional passphrase to secure the seed</small>
|
<label for="createPassphrase" class="line-b oh" ng-hide="setSeed || hwLedger || hwTrezor" ><span translate>Add a Seed Passphrase</span> <small translate>Add an optional passphrase to secure the seed</small>
|
||||||
|
|
@ -175,7 +174,7 @@
|
||||||
<span translate>Create {{requiredCopayers}}-of-{{totalCopayers}} wallet</span>
|
<span translate>Create {{requiredCopayers}}-of-{{totalCopayers}} wallet</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button type="submit" class="button round black expand m0" ng-show="totalCopayers == 1" ng-disabled="setupForm.$invalid || create.loading || create.hwWallet">
|
<button type="submit" class="button round black expand m0" ng-show="totalCopayers == 1" ng-disabled="setupForm.$invalid || create.loading || create.hwWallet">
|
||||||
<span translate>Create new wallet</span>
|
<span translate>Create new wallet</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('createController',
|
angular.module('copayApp.controllers').controller('createController',
|
||||||
function($scope, $rootScope, $location, $timeout, $log, lodash, go, profileService, configService, isCordova, gettext, ledger, trezor, isMobile) {
|
function($scope, $rootScope, $location, $timeout, $log, lodash, go, profileService, configService, isCordova, gettext, ledger, trezor, isMobile) {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
var config = configService.getSync();
|
||||||
var defaults = configService.getDefaults();
|
var defaults = configService.getDefaults();
|
||||||
this.isWindowsPhoneApp = isMobile.Windows() && isCordova;
|
this.isWindowsPhoneApp = isMobile.Windows() && isCordova;
|
||||||
|
|
||||||
|
|
@ -23,6 +24,9 @@ angular.module('copayApp.controllers').controller('createController',
|
||||||
12: 1,
|
12: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var defaults = configService.getDefaults();
|
||||||
|
$scope.bwsurl = defaults.bws.url;
|
||||||
|
|
||||||
// ng-repeat defined number of times instead of repeating over array?
|
// ng-repeat defined number of times instead of repeating over array?
|
||||||
this.getNumber = function(num) {
|
this.getNumber = function(num) {
|
||||||
return new Array(num);
|
return new Array(num);
|
||||||
|
|
@ -73,9 +77,9 @@ angular.module('copayApp.controllers').controller('createController',
|
||||||
}
|
}
|
||||||
|
|
||||||
if (form.hwLedger.$modelValue || form.hwTrezor.$modelValue) {
|
if (form.hwLedger.$modelValue || form.hwTrezor.$modelValue) {
|
||||||
self.hwWallet = form.hwLedger.$modelValue ? 'Ledger' : 'TREZOR';
|
self.hwWallet = form.hwLedger.$modelValue ? 'Ledger' : 'TREZOR';
|
||||||
|
|
||||||
var src= form.hwLedger.$modelValue ? ledger : trezor;
|
var src = form.hwLedger.$modelValue ? ledger : trezor;
|
||||||
|
|
||||||
// TODO : account
|
// TODO : account
|
||||||
var account = 0;
|
var account = 0;
|
||||||
|
|
@ -106,13 +110,24 @@ angular.module('copayApp.controllers').controller('createController',
|
||||||
$rootScope.$apply();
|
$rootScope.$apply();
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var opts_ = {
|
||||||
|
bws: {}
|
||||||
|
};
|
||||||
|
opts_.bws[walletId] = $scope.bwsurl;
|
||||||
|
configService.set(opts_, function(err) {
|
||||||
|
if (err) console.log(err);
|
||||||
|
$scope.$emit('Local/BWSUpdated');
|
||||||
|
applicationService.restart();
|
||||||
|
go.walletHome();
|
||||||
|
});
|
||||||
|
|
||||||
if (opts.mnemonic || opts.externalSource || opts.extendedPrivateKey) {
|
if (opts.mnemonic || opts.externalSource || opts.extendedPrivateKey) {
|
||||||
if (opts.n == 1) {
|
if (opts.n == 1) {
|
||||||
$rootScope.$emit('Local/WalletImported', walletId);
|
$rootScope.$emit('Local/WalletImported', walletId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
go.walletHome();
|
|
||||||
});
|
});
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue