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