Small code de-duplication

pull/5917/merge
Aleksander Machniak 7 years ago
parent 758044d69e
commit 489ad88617

@ -3573,17 +3573,15 @@ function rcube_webmail()
if (this.env.browser_capabilities) if (this.env.browser_capabilities)
this.env.browser_capabilities['pgpmime'] = 1; this.env.browser_capabilities['pgpmime'] = 1;
var keyring = this.env.user_id; var keyring = this.env.user_id,
fn = function(kr) {
mailvelope.getKeyring(keyring).then(function(kr) {
ref.mailvelope_keyring = kr; ref.mailvelope_keyring = kr;
ref.mailvelope_init(action, kr); ref.mailvelope_init(action, kr);
}, function(err) { };
mailvelope.getKeyring(keyring).then(fn, function(err) {
// attempt to create a new keyring for this app/user // attempt to create a new keyring for this app/user
mailvelope.createKeyring(keyring).then(function(kr) { mailvelope.createKeyring(keyring).then(fn, function(err) {
ref.mailvelope_keyring = kr;
ref.mailvelope_init(action, kr);
}, function(err) {
console.error(err); console.error(err);
}); });
}); });

Loading…
Cancel
Save