From cff9f567bbc5c6ec22152775331104bddfdea9c1 Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Wed, 3 Sep 2014 14:44:48 -0300 Subject: [PATCH] settings: no settings model after all --- js/controllers/settings.js | 2 -- js/models/core/Settings.js | 18 ------------------ js/models/core/Wallet.js | 9 +++------ 3 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 js/models/core/Settings.js diff --git a/js/controllers/settings.js b/js/controllers/settings.js index 3141d6d62..b8b5ed1a8 100644 --- a/js/controllers/settings.js +++ b/js/controllers/settings.js @@ -24,8 +24,6 @@ angular.module('copayApp.controllers').controller('SettingsController', function } } - - $scope.changeInsightSSL = function() { $scope.insightPort = $scope.insightSecure ? 80 : 443; }; diff --git a/js/models/core/Settings.js b/js/models/core/Settings.js deleted file mode 100644 index 8ec86fe53..000000000 --- a/js/models/core/Settings.js +++ /dev/null @@ -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; diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index db38f95e2..98c1971e4 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -25,7 +25,6 @@ var TxProposal = require('./TxProposal'); var TxProposals = require('./TxProposals'); var PrivateKey = require('./PrivateKey'); var WalletLock = require('./WalletLock'); -var Settings = require('./Settings'); var copayConfig = require('../../../config'); /** @@ -74,7 +73,7 @@ function Wallet(opts) { this.id = opts.id || Wallet.getRandomId(); this.secretNumber = opts.secretNumber || Wallet.getRandomNumber(); 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.publicKeyRing.walletId = this.id; @@ -781,9 +780,7 @@ Wallet.prototype.keepAlive = function() { */ Wallet.prototype.store = function() { this.keepAlive(); - - var wallet = this.toObj(); - this.storage.setFromObj(this.id, wallet); + this.storage.setFromObj(this.id, this.toObj()); log.debug('Wallet stored'); }; @@ -799,7 +796,7 @@ Wallet.prototype.toObj = function() { var walletObj = { opts: optsObj, - settings: this.settings.toObj(), + settings: this.settings, networkNonce: networkNonce, //yours networkNonces: networkNonces, //copayers publicKeyRing: this.publicKeyRing.toObj(),