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';
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.saveSettings(function(err) {
|
||||
preconditions.checkState(!err, err);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.services').factory('configService', function(localstorageService, gettextCatalog) {
|
||||
angular.module('copayApp.services').factory('configService', function($timeout, localstorageService, gettextCatalog) {
|
||||
var root = {};
|
||||
|
||||
root.set = function(opts, cb) {
|
||||
|
|
@ -22,10 +22,12 @@ angular.module('copayApp.services').factory('configService', function(localstora
|
|||
var newOpts = {};
|
||||
_.extend(newOpts, copay.defaultConfig, oldOpts, opts);
|
||||
|
||||
// TODO remove this gloval variable.
|
||||
// TODO remove this global variable.
|
||||
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