settings: create new model

This commit is contained in:
Manuel Araoz 2014-09-03 13:11:32 -03:00
commit d2861d9c2a
4 changed files with 32 additions and 22 deletions

View file

@ -37,24 +37,16 @@ angular.module('copayApp.controllers').controller('SettingsController', function
network.port = $scope.insightPort;
network.schema = $scope.insightSecure ? 'https' : 'http';
var insightSettings = {
host: $scope.insightHost,
port: $scope.insightPort,
schema: $scope.insightSecure ? 'https' : 'http',
}
localStorage.setItem('config', JSON.stringify({
networkName: $scope.networkName,
blockchain: {
host: $scope.insightHost,
port: $scope.insightPort,
schema: $scope.insightSecure ? 'https' : 'http',
},
socket: {
host: $scope.insightHost,
port: $scope.insightPort,
schema: $scope.insightSecure ? 'https' : 'http',
},
blockchain: insightSettings,
socket: insightSettings,
network: network,
unitName: $scope.selectedUnit.shortName,
unitToSatoshi: $scope.selectedUnit.value,
unitDecimals: $scope.selectedUnit.decimals,
alternativeName: $scope.selectedAlternative.name,
alternativeIsoCode: $scope.selectedAlternative.isoCode,
version: copay.version,
defaultLanguage: $scope.selectedLanguage.isoCode