add timeout to fix settings saving
This commit is contained in:
parent
87ea157c57
commit
3210c87ec1
2 changed files with 6 additions and 3 deletions
|
|
@ -160,6 +160,7 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
|
||||||
$scope.error = 'Please enter the required fields';
|
$scope.error = 'Please enter the required fields';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.saveSettings(function(err) {
|
$scope.saveSettings(function(err) {
|
||||||
preconditions.checkState(!err, err);
|
preconditions.checkState(!err, err);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.services').factory('configService', function(localstorageService, gettextCatalog) {
|
angular.module('copayApp.services').factory('configService', function($timeout, localstorageService, gettextCatalog) {
|
||||||
var root = {};
|
var root = {};
|
||||||
|
|
||||||
root.set = function(opts, cb) {
|
root.set = function(opts, cb) {
|
||||||
|
|
@ -22,10 +22,12 @@ angular.module('copayApp.services').factory('configService', function(localstora
|
||||||
var newOpts = {};
|
var newOpts = {};
|
||||||
_.extend(newOpts, copay.defaultConfig, oldOpts, opts);
|
_.extend(newOpts, copay.defaultConfig, oldOpts, opts);
|
||||||
|
|
||||||
// TODO remove this gloval variable.
|
// TODO remove this global variable.
|
||||||
config = newOpts;
|
config = newOpts;
|
||||||
|
|
||||||
localstorageService.setItem('config', JSON.stringify(newOpts), cb);
|
localstorageService.setItem('config', JSON.stringify(newOpts), function() {
|
||||||
|
$timeout(cb, 1);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue