bws is moved to preferences->advanced and set it locally

This commit is contained in:
Javier 2015-10-15 16:32:10 -03:00
parent 3a2fcaecbc
commit b2e92b9424
4 changed files with 14 additions and 15 deletions

View File

@ -115,13 +115,6 @@
<span>Enable Glidera Service</span>
<switch id="glidera-enabled" name="glideraEnabled" ng-model="glideraEnabled" class="green right"></switch>
</li>
<li ng-click="$root.go('preferencesBwsUrl')">
<span>Bitcore Wallet Service</span>
<span class="text-gray db">
<i class="icon-arrow-right3 size-24 right"></i>
{{preferences.bwsurl}}
</span>
</li>
<!-- Disabled for testnet
<li ng-show="!index.noFocusedWallet && glideraEnabled">

View File

@ -24,6 +24,11 @@
<i class="icon-arrow-right3 size-24 right text-gray"></i>
<span translate>Export Wallet</span>
</li>
<li ng-click="$root.go('preferencesBwsUrl')">
<i class="icon-arrow-right3 size-24 right text-gray"></i>
<span translate>Bitcore Wallet Service</span>
</li>
<li ng-click="$root.go('delete')">
<i class="icon-arrow-right3 size-24 right text-gray"></i>

View File

@ -1,7 +1,7 @@
<div
class="topbar-container"
ng-include="'views/includes/topbar.html'"
ng-init="titleSection='Bitcore Wallet Service'; goBackToState = 'preferences'; noColor = true">
ng-init="titleSection='Bitcore Wallet Service'; goBackToState = 'preferencesAdvanced'; noColor = true">
</div>

View File

@ -1,13 +1,17 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesBwsUrlController',
function($scope,$log, configService, go, applicationService ) {
function($scope, $log, configService, go, applicationService, profileService) {
this.error = null;
this.success = null;
var fc = profileService.focusedClient; +
var walletId = fc.credentials.walletId; +
var defaults = configService.getDefaults();
var config = configService.getSync();
this.bwsurl = config.bws.url;
config.bws = config.bws || {};
this.bwsurl = config.bws[walletId] || defaults.bws.url;
this.save = function() {
@ -32,10 +36,9 @@ angular.module('copayApp.controllers').controller('preferencesBwsUrlController',
}
var opts = {
bws: {
url: this.bwsurl,
}
bws: {}
};
opts.bws[walletId] = this.bwsurl;
configService.set(opts, function(err) {
if (err) console.log(err);
@ -43,6 +46,4 @@ angular.module('copayApp.controllers').controller('preferencesBwsUrlController',
applicationService.restart();
});
};
});