diff --git a/config.js b/config.js index 3113c9b8e..6ccd05934 100644 --- a/config.js +++ b/config.js @@ -73,24 +73,23 @@ var defaultConfig = { salt: 'jBbYTj8zTrOt6V', }, + /* GoogleDrive: { home: 'copay', - /* - * This clientId was generated at: - * https://console.developers.google.com/project - * To run Copay with Google Drive at your domain you need - * to generata your own Id. - */ + + // This clientId was generated at: + // https://console.developers.google.com/project + // To run Copay with Google Drive at your domain you need + // to generata your own Id. // for localhost:3001 you can use you can: + // clientId: '232630733383-a35gcnovnkgka94394i88gq60vtjb4af.apps.googleusercontent.com', // for copay.io: // clientId: '1036948132229-biqm3b8sirik9lt5rtvjo9kjjpotn4ac.apps.googleusercontent.com', }, - - developmentFeatures: false - + */ }; if (typeof module !== 'undefined') module.exports = defaultConfig; diff --git a/js/app.js b/js/app.js index f93bf2ac1..0f8d9bbec 100644 --- a/js/app.js +++ b/js/app.js @@ -8,6 +8,7 @@ var ls = new LS(); // TODO move this to configService ! var config = copay.defaultConfig; + ls.getItem('config', function(err, data) { var localConfig; try { diff --git a/js/controllers/settings.js b/js/controllers/settings.js index 3c09a26e9..f432f0e35 100644 --- a/js/controllers/settings.js +++ b/js/controllers/settings.js @@ -77,7 +77,6 @@ angular.module('copayApp.controllers').controller('SettingsController', function configService.set({ network: insightSettings, - version: copay.version, defaultLanguage: $scope.selectedLanguage.isoCode, plugins: plugins, logLevel: $scope.selectedLogLevel.name, diff --git a/js/services/configService.js b/js/services/configService.js index ed4c517d8..2bc032826 100644 --- a/js/services/configService.js +++ b/js/services/configService.js @@ -5,16 +5,18 @@ angular.module('copayApp.services').factory('configService', function($timeout, root.set = function(opts, cb) { + // Options that have runtime effects if (opts.logLevel) copay.logger.setLevel(opts.logLevel); if (opts.defaultLanguage) gettextCatalog.currentLanguage = opts.defaultLanguage; + // Set current version + opts.version = copay.version; + localstorageService.getItem('config', function(err, oldOpsStr) { - var oldOpts = {}; - try { oldOpts = JSON.parse(oldOpsStr); } catch (e) {}; @@ -24,10 +26,7 @@ angular.module('copayApp.services').factory('configService', function($timeout, // TODO remove this global variable. config = newOpts; - - localstorageService.setItem('config', JSON.stringify(newOpts), function() { - $timeout(cb, 1); - }); + localstorageService.setItem('config', JSON.stringify(newOpts), cb); }); }; diff --git a/js/services/identityService.js b/js/services/identityService.js index 1aadaa817..8dcc89a04 100644 --- a/js/services/identityService.js +++ b/js/services/identityService.js @@ -184,7 +184,8 @@ angular.module('copayApp.services') w.on('ready', function() { var isFocused = root.isFocused(wid); - copay.logger.debug('Wallet:' + w.getName() + ' is ready. Focused:', isFocused); + copay.logger.debug('Wallet:' + w.getName() + + ' is ready. Focused:', isFocused); balanceService.update(w, function() { $rootScope.$digest();