Set default ports automatically on Insight URLs

This commit is contained in:
Matias Pando 2014-10-15 18:16:37 -03:00
commit 28d888b75f
4 changed files with 93 additions and 8 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('SettingsController', function($scope, $rootScope, $window, $location, controllerUtils, notification) {
angular.module('copayApp.controllers').controller('SettingsController', function($scope, $rootScope, $window, $location, controllerUtils) {
controllerUtils.redirIfLogged();
$scope.title = 'Settings';
@ -8,6 +8,7 @@ angular.module('copayApp.controllers').controller('SettingsController', function
$scope.insightLivenet = config.network.livenet.url;
$scope.insightTestnet = config.network.testnet.url;
$scope.availableLanguages = [{
name: 'English',
isoCode: 'en',
@ -23,7 +24,12 @@ angular.module('copayApp.controllers').controller('SettingsController', function
}
}
$scope.save = function() {
$scope.insightLivenet = copay.Insight.setCompleteUrl($scope.insightLivenet);
$scope.insightTestnet = copay.Insight.setCompleteUrl($scope.insightTestnet);
var insightSettings = {
livenet: {
url: $scope.insightLivenet,
@ -33,6 +39,7 @@ angular.module('copayApp.controllers').controller('SettingsController', function
},
}
localStorage.setItem('config', JSON.stringify({
network: insightSettings,
version: copay.version,