settings: change old settings controller
This commit is contained in:
parent
f9a31ce9aa
commit
f443843d49
3 changed files with 10 additions and 16 deletions
|
|
@ -26,8 +26,8 @@ angular.module('copayApp.controllers').controller('MoreController',
|
|||
decimals: 8
|
||||
}];
|
||||
$scope.selectedAlternative = {
|
||||
name: config.alternativeName,
|
||||
isoCode: config.alternativeIsoCode
|
||||
name: w.settings.alternativeName,
|
||||
isoCode: w.settings.alternativeIsoCode
|
||||
};
|
||||
$scope.alternativeOpts = rateService.isAvailable ?
|
||||
rateService.listAlternatives() : [$scope.selectedAlternative];
|
||||
|
|
@ -35,7 +35,7 @@ angular.module('copayApp.controllers').controller('MoreController',
|
|||
rateService.whenAvailable(function() {
|
||||
$scope.alternativeOpts = rateService.listAlternatives();
|
||||
for (var ii in $scope.alternativeOpts) {
|
||||
if (config.alternativeIsoCode === $scope.alternativeOpts[ii].isoCode) {
|
||||
if (w.settings.alternativeIsoCode === $scope.alternativeOpts[ii].isoCode) {
|
||||
$scope.selectedAlternative = $scope.alternativeOpts[ii];
|
||||
}
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ angular.module('copayApp.controllers').controller('MoreController',
|
|||
|
||||
|
||||
for (var ii in $scope.unitOpts) {
|
||||
if (config.unitName === $scope.unitOpts[ii].shortName) {
|
||||
if (w.settings.unitName === $scope.unitOpts[ii].shortName) {
|
||||
$scope.selectedUnit = $scope.unitOpts[ii];
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ angular.module('copayApp.controllers').controller('SettingsController', function
|
|||
|
||||
controllerUtils.redirIfLogged();
|
||||
$scope.title = 'Settings';
|
||||
$scope.insightHost = config.blockchain.host;
|
||||
$scope.insightPort = config.blockchain.port;
|
||||
$scope.insightSecure = config.blockchain.schema === 'https';
|
||||
$scope.insightHost = config.network.host;
|
||||
$scope.insightPort = config.network.port;
|
||||
$scope.insightSecure = config.network.schema === 'https';
|
||||
$scope.defaultLanguage = config.defaultLanguage || 'en';
|
||||
|
||||
$scope.availableLanguages = [{
|
||||
|
|
@ -33,9 +33,6 @@ angular.module('copayApp.controllers').controller('SettingsController', function
|
|||
|
||||
$scope.save = function() {
|
||||
var network = config.network;
|
||||
network.host = $scope.insightHost;
|
||||
network.port = $scope.insightPort;
|
||||
network.schema = $scope.insightSecure ? 'https' : 'http';
|
||||
|
||||
var insightSettings = {
|
||||
host: $scope.insightHost,
|
||||
|
|
@ -44,11 +41,8 @@ angular.module('copayApp.controllers').controller('SettingsController', function
|
|||
}
|
||||
|
||||
localStorage.setItem('config', JSON.stringify({
|
||||
blockchain: insightSettings,
|
||||
socket: insightSettings,
|
||||
network: network,
|
||||
|
||||
version: copay.version,
|
||||
network: insightSettings,
|
||||
version: copay.version
|
||||
defaultLanguage: $scope.selectedLanguage.isoCode
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -799,7 +799,7 @@ Wallet.prototype.toObj = function() {
|
|||
|
||||
var walletObj = {
|
||||
opts: optsObj,
|
||||
settings: this.settings.toObj();
|
||||
settings: this.settings.toObj(),
|
||||
networkNonce: networkNonce, //yours
|
||||
networkNonces: networkNonces, //copayers
|
||||
publicKeyRing: this.publicKeyRing.toObj(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue