Wallet/src/js/controllers/preferencesEmail.js
2016-06-06 19:15:17 -03:00

24 lines
618 B
JavaScript

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