mirror of https://github.com/BTCPrivate/copay.git
fix set config
This commit is contained in:
parent
fb588117b1
commit
7d5ed4595c
17
config.js
17
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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue