diff --git a/js/app.js b/js/app.js index e1ddb0b7a..5209dea82 100644 --- a/js/app.js +++ b/js/app.js @@ -4,6 +4,7 @@ var copay = require('copay'); var _ = require('underscore'); var config = defaultConfig; var localConfig = JSON.parse(localStorage.getItem('config')); +var defaults = JSON.parse(JSON.stringify(defaultConfig)); if (localConfig) { var cmv = copay.version.split('.')[1]; @@ -38,6 +39,8 @@ if (Object.keys(config.plugins).length) var copayApp = window.copayApp = angular.module('copayApp', modules); +copayApp.value('defaults', defaults); + copayApp.config(function($sceDelegateProvider) { $sceDelegateProvider.resourceUrlWhitelist([ 'self', diff --git a/js/controllers/create.js b/js/controllers/create.js index 448b618f7..77059bb92 100644 --- a/js/controllers/create.js +++ b/js/controllers/create.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('CreateController', - function($scope, $rootScope, $location, $timeout, walletFactory, controllerUtils, Passphrase, backupService, notification) { + function($scope, $rootScope, $location, $timeout, walletFactory, controllerUtils, Passphrase, backupService, notification, defaults) { controllerUtils.redirIfLogged(); $rootScope.fromSetup = true; @@ -10,6 +10,7 @@ angular.module('copayApp.controllers').controller('CreateController', $scope.isMobile = !!window.cordova; $scope.hideAdv = true; $scope.networkName = config.networkName; + $scope.networkUrl = config.network[$scope.networkName].url; // ng-repeat defined number of times instead of repeating over array? $scope.getNumber = function(num) { @@ -31,6 +32,14 @@ angular.module('copayApp.controllers').controller('CreateController', updateRCSelect(tc); }); + $scope.$watch('networkName', function(tc) { + $scope.networkUrl = config.network[$scope.networkName].url; + }); + + $scope.showNetwork = function(){ + return $scope.networkUrl != defaults.network.livenet.url && $scope.networkUrl != defaults.network.testnet.url; + }; + $scope.create = function(form) { if (form && form.$invalid) { notification.error('Error', 'Please enter the required fields'); diff --git a/views/create.html b/views/create.html index b2eef27ed..6554e561b 100644 --- a/views/create.html +++ b/views/create.html @@ -88,6 +88,7 @@ Next +

Using network: {{networkName}} at {{networkUrl}}