delete fc from preferences

This commit is contained in:
Gabriel Bazán 2016-08-17 15:53:17 -03:00
commit 4e599c38e7
24 changed files with 173 additions and 243 deletions

View file

@ -1,17 +1,16 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesEmailController', function($rootScope, $scope, go, profileService, walletService) {
angular.module('copayApp.controllers').controller('preferencesEmailController', function($rootScope, $scope, $state, $stateParams, profileService, walletService) {
$scope.save = function(form) {
var fc = profileService.focusedClient;
var wallet = profileService.getWallet($stateParams.walletId);
var email = $scope.email || '';
walletService.updateRemotePreferences(fc, {
walletService.updateRemotePreferences(wallet, {
email: email,
}, function(err) {
if (!err)
$rootScope.$emit('Local/EmailUpdated', email);
go.path('preferences');
if (err) $log.warn(err);
$state.go('wallet.preferences');
});
};