2015-05-14 17:21:45 -03:00
|
|
|
'use strict';
|
|
|
|
|
|
2016-08-17 15:53:17 -03:00
|
|
|
angular.module('copayApp.controllers').controller('preferencesEmailController', function($rootScope, $scope, $state, $stateParams, profileService, walletService) {
|
2016-08-16 16:47:51 -03:00
|
|
|
|
2016-06-13 16:13:35 -03:00
|
|
|
$scope.save = function(form) {
|
2016-08-17 15:53:17 -03:00
|
|
|
var wallet = profileService.getWallet($stateParams.walletId);
|
2016-06-13 16:13:35 -03:00
|
|
|
var email = $scope.email || '';
|
2015-05-14 17:21:45 -03:00
|
|
|
|
2016-08-17 15:53:17 -03:00
|
|
|
walletService.updateRemotePreferences(wallet, {
|
2016-06-13 16:13:35 -03:00
|
|
|
email: email,
|
|
|
|
|
}, function(err) {
|
2016-08-17 15:53:17 -03:00
|
|
|
if (err) $log.warn(err);
|
|
|
|
|
$state.go('wallet.preferences');
|
2016-06-13 16:13:35 -03:00
|
|
|
});
|
|
|
|
|
};
|
2016-08-16 16:47:51 -03:00
|
|
|
|
2016-06-13 16:13:35 -03:00
|
|
|
});
|