diff --git a/public/views/create.html b/public/views/create.html index e2909aec1..03465eff6 100644 --- a/public/views/create.html +++ b/public/views/create.html @@ -132,10 +132,9 @@ - Specify Bitcore Wallet Service - + Specify Bitcore Wallet Service URL + - Add a Seed Passphrase Add an optional passphrase to secure the seed @@ -175,7 +174,7 @@ Create {{requiredCopayers}}-of-{{totalCopayers}} wallet - + Create new wallet diff --git a/src/js/controllers/create.js b/src/js/controllers/create.js index 84493520f..8c1442016 100644 --- a/src/js/controllers/create.js +++ b/src/js/controllers/create.js @@ -1,9 +1,10 @@ 'use strict'; 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 config = configService.getSync(); var defaults = configService.getDefaults(); this.isWindowsPhoneApp = isMobile.Windows() && isCordova; @@ -23,6 +24,9 @@ angular.module('copayApp.controllers').controller('createController', 12: 1, }; + var defaults = configService.getDefaults(); + $scope.bwsurl = defaults.bws.url; + // ng-repeat defined number of times instead of repeating over array? this.getNumber = function(num) { return new Array(num); @@ -73,9 +77,9 @@ angular.module('copayApp.controllers').controller('createController', } 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 var account = 0; @@ -106,13 +110,24 @@ angular.module('copayApp.controllers').controller('createController', $rootScope.$apply(); }); 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.n == 1) { $rootScope.$emit('Local/WalletImported', walletId); } } - go.walletHome(); }); }, 100); }