Skip to content

Commit

Permalink
Small code de-duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Dec 2, 2017
1 parent 758044d commit 489ad88
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions program/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3573,17 +3573,15 @@ function rcube_webmail()
if (this.env.browser_capabilities)
this.env.browser_capabilities['pgpmime'] = 1;

var keyring = this.env.user_id;

mailvelope.getKeyring(keyring).then(function(kr) {
ref.mailvelope_keyring = kr;
ref.mailvelope_init(action, kr);
}, function(err) {
// attempt to create a new keyring for this app/user
mailvelope.createKeyring(keyring).then(function(kr) {
var keyring = this.env.user_id,
fn = function(kr) {
ref.mailvelope_keyring = 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
mailvelope.createKeyring(keyring).then(fn, function(err) {
console.error(err);
});
});
Expand Down

0 comments on commit 489ad88

Please sign in to comment.