disable email notifications
This commit is contained in:
parent
68d3195f7f
commit
2a390760bc
3 changed files with 14 additions and 8 deletions
|
|
@ -2,23 +2,25 @@
|
|||
|
||||
angular.module('copayApp.controllers').controller('preferencesEmailController', function($scope, $ionicHistory, $stateParams, gettextCatalog, profileService, walletService, configService) {
|
||||
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
var walletId = wallet.credentials.walletId;
|
||||
$scope.wallet = profileService.getWallet($stateParams.walletId);
|
||||
var walletId = $scope.wallet.credentials.walletId;
|
||||
|
||||
var config = configService.getSync();
|
||||
config.emailFor = config.emailFor || {};
|
||||
$scope.emailForExist = config.emailFor && config.emailFor[walletId];
|
||||
$scope.email = {
|
||||
value: config.emailFor && config.emailFor[walletId]
|
||||
};
|
||||
|
||||
$scope.save = function() {
|
||||
|
||||
$scope.save = function(val) {
|
||||
var opts = {
|
||||
emailFor: {}
|
||||
};
|
||||
opts.emailFor[walletId] = $scope.email.value;
|
||||
opts.emailFor[walletId] = val;
|
||||
|
||||
walletService.updateRemotePreferences(wallet, {
|
||||
email: $scope.email.value,
|
||||
walletService.updateRemotePreferences($scope.wallet, {
|
||||
email: val,
|
||||
}, function(err) {
|
||||
if (err) $log.warn(err);
|
||||
configService.set(opts, function(err) {
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@
|
|||
color: $mid-gray;
|
||||
margin: 1rem 0;
|
||||
}
|
||||
&-description-disabled {
|
||||
color: cadetblue;
|
||||
}
|
||||
.setting-title, .setting-value {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
|
|
|
|||
|
|
@ -9,10 +9,11 @@
|
|||
<ion-content>
|
||||
<div class="settings-explaination">
|
||||
<div class="settings-description" translate>
|
||||
You'll receive email notifications about payments sent and received from this wallet.
|
||||
You'll receive email notifications about payments sent and received from {{wallet.name}}.
|
||||
</div>
|
||||
<span ng-if="emailForExist" class="settings-description-disabled" ng-click="save(null)" translate>Disable notifications</span>
|
||||
</div>
|
||||
<form name="emailForm" ng-submit="save(emailForm)" novalidate>
|
||||
<form name="emailForm" ng-submit="save(email.value)" novalidate>
|
||||
<div class="list settings-input-group">
|
||||
<label class="item item-input item-stacked-label">
|
||||
<span class="input-label" translate>Email Address</span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue