settings: no settings model after all

This commit is contained in:
Manuel Araoz 2014-09-03 14:44:48 -03:00
commit cff9f567bb
3 changed files with 3 additions and 26 deletions

View file

@ -24,8 +24,6 @@ angular.module('copayApp.controllers').controller('SettingsController', function
} }
} }
$scope.changeInsightSSL = function() { $scope.changeInsightSSL = function() {
$scope.insightPort = $scope.insightSecure ? 80 : 443; $scope.insightPort = $scope.insightSecure ? 80 : 443;
}; };

View file

@ -1,18 +0,0 @@
'use strict';
var preconditions = require('preconditions').singleton();
var log = require('../../log');
var copayConfig = require('../../../config');
function Settings(opts) {
var self = this;
}
Settings.prototype.toObj = function() {
return {
}
};
module.exports = Settings;

View file

@ -25,7 +25,6 @@ var TxProposal = require('./TxProposal');
var TxProposals = require('./TxProposals'); var TxProposals = require('./TxProposals');
var PrivateKey = require('./PrivateKey'); var PrivateKey = require('./PrivateKey');
var WalletLock = require('./WalletLock'); var WalletLock = require('./WalletLock');
var Settings = require('./Settings');
var copayConfig = require('../../../config'); var copayConfig = require('../../../config');
/** /**
@ -74,7 +73,7 @@ function Wallet(opts) {
this.id = opts.id || Wallet.getRandomId(); this.id = opts.id || Wallet.getRandomId();
this.secretNumber = opts.secretNumber || Wallet.getRandomNumber(); this.secretNumber = opts.secretNumber || Wallet.getRandomNumber();
this.lock = new WalletLock(this.storage, this.id, opts.lockTimeOutMin); this.lock = new WalletLock(this.storage, this.id, opts.lockTimeOutMin);
this.settings = new Settings(opts.settings); this.settings = opts.settings || copayConfig.settings;
this.name = opts.name; this.name = opts.name;
this.publicKeyRing.walletId = this.id; this.publicKeyRing.walletId = this.id;
@ -781,9 +780,7 @@ Wallet.prototype.keepAlive = function() {
*/ */
Wallet.prototype.store = function() { Wallet.prototype.store = function() {
this.keepAlive(); this.keepAlive();
this.storage.setFromObj(this.id, this.toObj());
var wallet = this.toObj();
this.storage.setFromObj(this.id, wallet);
log.debug('Wallet stored'); log.debug('Wallet stored');
}; };
@ -799,7 +796,7 @@ Wallet.prototype.toObj = function() {
var walletObj = { var walletObj = {
opts: optsObj, opts: optsObj,
settings: this.settings.toObj(), settings: this.settings,
networkNonce: networkNonce, //yours networkNonce: networkNonce, //yours
networkNonces: networkNonces, //copayers networkNonces: networkNonces, //copayers
publicKeyRing: this.publicKeyRing.toObj(), publicKeyRing: this.publicKeyRing.toObj(),