diff options
| -rw-r--r-- | inbox_settings.php | 2 | ||||
| -rw-r--r-- | keys.js | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/inbox_settings.php b/inbox_settings.php index d7fdc4b..ca806e0 100644 --- a/inbox_settings.php +++ b/inbox_settings.php @@ -238,7 +238,7 @@ class inbox_settings extends rcube_plugin { $this->rcmail->output->command( 'display_message', $this->gettext('keys_imported'), 'notice'); - return isset($_POST['refresh']) ? boolval($_POST['refresh']) : true; + return !isset($_POST['no_refresh']); } function render_import_ui() { @@ -39,14 +39,17 @@ rcube_webmail.prototype.inbox_keys_generate = function() { this.hide_message(generating_message); var lock = this.display_message( this.get_label('inbox_settings.importing_key'), 'loading'); - this.addEventListener('responseafter', () => { + this.addEventListener('responseafter', resp => { + if (resp.response.action != 'plugin.inbox_keys_import') + return; + location.href = 'data:application/pgp-keys;base64,' + btoa(generated.privateKey); this.reload(1500); }); this.http_post( 'plugin.inbox_keys_import', - {import: true, refresh: false, key_data: generated.publicKey, comment}, + {import: true, no_refresh: true, key_data: generated.publicKey, comment}, lock); }); }; |
