From 4d160a4ee751195c0686c46bf9484683644290ad Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Tue, 8 Jul 2014 18:53:02 -0300 Subject: [PATCH] Fixes: * Save config in localStorage * Show forced networkName in settings Page --- index.html | 11 ++++++----- js/app.js | 3 +++ js/models/core/Wallet.js | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index cac7012c4..b9461be13 100644 --- a/index.html +++ b/index.html @@ -849,13 +849,14 @@
Bitcoin Network -
+ ng-true-value="livenet" ng-false-value="testnet" class="form-control" ng-click="changeNetwork()" + ng-disabled="forceNetwork" + ng-checked="networkName == 'livenet' ? true : false"> -
-
- Network has been fixed to {{networkName}} in this setup. See copay.io +
+ Network has been fixed to + {{networkName}} in this setup. See copay.io for options to use Copay on both livenet and testnet.
diff --git a/js/app.js b/js/app.js index 624c12f0d..01c36efb6 100644 --- a/js/app.js +++ b/js/app.js @@ -7,6 +7,9 @@ if (localConfig) { var count = 0; for (name in localConfig) { if (localConfig.hasOwnProperty(name)) { + if (name === 'networkName' && config['forceNetwork']) { + continue; + } config[name] = localConfig[name]; } } diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index 5e0be4c44..a67b22b2b 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -34,9 +34,9 @@ function Wallet(opts) { throw new Error('missing required option for Wallet: ' + k); self[k] = opts[k]; }); - if (copayConfig.forceNetwork && opts.networkName !== copayConfig.networkName) + if (copayConfig.forceNetwork && this.getNetworkName() !== copayConfig.networkName) throw new Error('Network forced to '+copayConfig.networkName+ - ' and tried to create a Wallet with network '+opts.networkName); + ' and tried to create a Wallet with network '+ this.getNetworkName()); this.log('creating ' + opts.requiredCopayers + ' of ' + opts.totalCopayers + ' wallet');