fixing routes on settings

This commit is contained in:
Gabriel Bazán 2016-08-23 12:01:09 -03:00
commit bce77de16c
8 changed files with 15 additions and 17 deletions

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesAltCurrencyController',
function($scope, $log, $timeout, configService, rateService, lodash, profileService, walletService, $state) {
function($scope, $log, $state, $timeout, configService, rateService, lodash, profileService, walletService) {
var next = 10;
var completeAlternativeList;
@ -42,9 +42,9 @@ angular.module('copayApp.controllers').controller('preferencesAltCurrencyControl
configService.set(opts, function(err) {
if (err) $log.warn(err);
$state.go('preferencesGlobal');
$scope.$emit('Local/UnitSettingUpdated');
walletService.updateRemotePreferences(profileService.getClients(), {}, function() {
$state.go('tabs.settings');
walletService.updateRemotePreferences(profileService.getWallets(), {}, function() {
$log.debug('Remote preferences saved');
});
});

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesLanguageController',
function($scope, $log, $state, configService, profileService, uxLanguage, walletService, go) {
function($scope, $log, $state, configService, profileService, uxLanguage, walletService) {
$scope.init = function() {
$scope.availableLanguages = uxLanguage.getLanguages();
@ -19,10 +19,10 @@ angular.module('copayApp.controllers').controller('preferencesLanguageController
configService.set(opts, function(err) {
if (err) $log.warn(err);
go.preferencesGlobal();
$state.go('tabs.settings')
uxLanguage.update(function() {
walletService.updateRemotePreferences(profileService.getClients(), {}, function() {
walletService.updateRemotePreferences(profileService.getWallets(), {}, function() {
$log.debug('Remote preferences saved');
});
});

View file

@ -36,10 +36,8 @@ angular.module('copayApp.controllers').controller('preferencesUnitController', f
configService.set(opts, function(err) {
if (err) $log.warn(err);
$state.go('preferencesGlobal');
$scope.$emit('Local/UnitSettingUpdated');
walletService.updateRemotePreferences(profileService.getClients(), {}, function() {
$state.go('tabs.settings');
walletService.updateRemotePreferences(profileService.getWallets(), {}, function() {
$log.debug('Remote preferences saved');
});
});

View file

@ -3,8 +3,8 @@ angular.module('copayApp.services')
.factory('applicationService', function($rootScope, $timeout, platformInfo, $state) {
var root = {};
var isChromeApp = platformInfo.isChromeApp;
var isNW = platformInfo.isNW;
var isChromeApp = platformInfo.isChromeApp;
var isNW = platformInfo.isNW;
root.restart = function() {
var hashIndex = window.location.href.indexOf('#/');