Revert "Add toggle for email notifications"
This commit is contained in:
parent
ef63305d76
commit
9fb1302661
6 changed files with 49 additions and 100 deletions
|
|
@ -85,10 +85,6 @@ angular.module('copayApp.services').factory('configService', function(storageSer
|
|||
windows: {},
|
||||
}
|
||||
},
|
||||
|
||||
emailNotifications: {
|
||||
enabled: true,
|
||||
},
|
||||
};
|
||||
|
||||
var configCache = null;
|
||||
|
|
|
|||
|
|
@ -1,36 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.services').factory('emailService', function($log, configService, profileService, lodash, walletService) {
|
||||
var root = {};
|
||||
|
||||
root.enableEmailNotifications = function(val) {
|
||||
val = val || false;
|
||||
|
||||
var config = configService.getSync();
|
||||
|
||||
if (!config.emailFor) {
|
||||
$log.debug('No email configuration available');
|
||||
return;
|
||||
}
|
||||
|
||||
var keys = lodash.keys(config.emailFor);
|
||||
var wallets = lodash.map(keys, function(k) {
|
||||
return profileService.getWallet(k);
|
||||
});
|
||||
|
||||
if (!wallets) {
|
||||
$log.debug('No wallets found');
|
||||
return;
|
||||
}
|
||||
|
||||
lodash.each(wallets, function(w) {
|
||||
walletService.updateRemotePreferences(w, {
|
||||
email: val ? config.emailFor[w.credentials.walletId] : null
|
||||
}, function(err) {
|
||||
if (err) $log.warn(err);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
return root;
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue