diff --git a/js/controllers/createProfile.js b/js/controllers/createProfile.js index 509cf6b13..8e6719c8e 100644 --- a/js/controllers/createProfile.js +++ b/js/controllers/createProfile.js @@ -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); diff --git a/js/services/configService.js b/js/services/configService.js index f34013165..ed4c517d8 100644 --- a/js/services/configService.js +++ b/js/services/configService.js @@ -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); + }); }); };