Return automatically after set unit/lang/alt/color

This commit is contained in:
Gustavo Maximiliano Cortez 2015-11-13 16:00:28 -03:00
commit 370fbd5924
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
9 changed files with 31 additions and 18 deletions

View file

@ -868,6 +868,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.updateHistory = function() {
var fc = profileService.focusedClient;
if (!fc) return;
var walletId = fc.credentials.walletId;
if (!fc.isComplete() || self.updatingTxHistory[walletId]) return;

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesAltCurrencyController',
function($scope, $rootScope, configService, go, rateService, lodash) {
function($scope, $timeout, $log, configService, rateService, lodash, go) {
this.hideAdv = true;
this.hidePriv = true;
this.hideSecret = true;
@ -48,8 +48,12 @@ angular.module('copayApp.controllers').controller('preferencesAltCurrencyControl
};
configService.set(opts, function(err) {
if (err) console.log(err);
if (err) $log.warn(err);
go.preferencesGlobal();
$scope.$emit('Local/UnitSettingUpdated');
$timeout(function() {
$scope.$apply();
}, 100);
});
};

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesColorController',
function($scope, configService, profileService, go) {
function($scope, $timeout, $log, configService, profileService, go) {
var config = configService.getSync();
this.colorOpts = [
'#DD4B39',
@ -33,12 +33,12 @@ angular.module('copayApp.controllers').controller('preferencesColorController',
opts.colorFor[walletId] = color;
configService.set(opts, function(err) {
if (err) {
$scope.$emit('Local/DeviceError', err);
return;
}
self.color = color;
if (err) $log.warn(err);
go.preferences();
$scope.$emit('Local/ColorUpdated');
$timeout(function() {
$scope.$apply();
}, 100);
});
};

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesLanguageController',
function($scope, $log, $timeout, configService, uxLanguage) {
function($scope, $log, $timeout, configService, uxLanguage, go) {
this.availableLanguages = uxLanguage.getLanguages();
@ -17,6 +17,7 @@ angular.module('copayApp.controllers').controller('preferencesLanguageController
configService.set(opts, function(err) {
if (err) $log.warn(err);
go.preferencesGlobal();
$scope.$emit('Local/LanguageSettingUpdated');
$timeout(function() {
$scope.$apply();

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesUnitController',
function($rootScope, $scope, $log, configService, go) {
function($scope, $timeout, $log, configService, go) {
var config = configService.getSync();
this.unitName = config.wallet.settings.unitName;
this.unitOpts = [
@ -52,8 +52,11 @@ angular.module('copayApp.controllers').controller('preferencesUnitController',
configService.set(opts, function(err) {
if (err) $log.warn(err);
go.preferencesGlobal();
$scope.$emit('Local/UnitSettingUpdated');
go.preferences();
$timeout(function() {
$scope.$apply();
}, 100);
});
};

View file

@ -79,6 +79,10 @@ angular.module('copayApp.services').factory('go', function($window, $rootScope,
$state.go('preferences');
};
root.preferencesGlobal = function() {
$state.go('preferencesGlobal');
};
root.reload = function() {
$state.reload();
};