refactor preferences

This commit is contained in:
Matias Alejo Garcia 2016-06-06 18:26:45 -03:00
commit 1e2555dad9
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
15 changed files with 222 additions and 200 deletions

View file

@ -1,14 +1,22 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesEmailController',
function($scope, go, profileService, gettext, $log) {
function($rootScope, go, profileService, gettext, $log, walletService) {
this.save = function(form) {
var self = this;
this.error = null;
var fc = profileService.focusedClient;
this.saving = true;
$scope.$emit('Local/EmailSettingUpdated', fc,self.email, function() {
var email = self.email || '';
walletService.updateRemotePreferences(fc, {
email: email,
}, function(err) {
if (!err)
$rootScope.$emit('Local/EmailUpdated', email);
self.saving = false;
go.path('preferences');
});