2015-05-14 17:21:45 -03:00
|
|
|
'use strict';
|
|
|
|
|
|
2016-06-14 15:11:56 -03:00
|
|
|
angular.module('copayApp.controllers').controller('preferencesEmailController', function($rootScope, $scope, go, profileService, walletService) {
|
2016-06-13 16:13:35 -03:00
|
|
|
$scope.save = function(form) {
|
|
|
|
|
$scope.error = null;
|
|
|
|
|
$scope.saving = true;
|
|
|
|
|
var fc = profileService.focusedClient;
|
|
|
|
|
var email = $scope.email || '';
|
2015-05-14 17:21:45 -03:00
|
|
|
|
2016-06-13 16:13:35 -03:00
|
|
|
walletService.updateRemotePreferences(fc, {
|
|
|
|
|
email: email,
|
|
|
|
|
}, function(err) {
|
|
|
|
|
$scope.saving = false;
|
|
|
|
|
if (!err)
|
|
|
|
|
$rootScope.$emit('Local/EmailUpdated', email);
|
|
|
|
|
go.path('preferences');
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
});
|