From fe67a55d8744aede22f69b53b5ce0b983a3f4823 Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Thu, 15 Jun 2017 11:27:32 +0200 Subject: [feat] Add a 'fetch' flag to key export If is set keyamanger will try to discover and download the key. - Resolves: #8821 --- ui/app/lib/bitmask.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'ui/app/lib/bitmask.js') diff --git a/ui/app/lib/bitmask.js b/ui/app/lib/bitmask.js index 9d77224..72c027c 100644 --- a/ui/app/lib/bitmask.js +++ b/ui/app/lib/bitmask.js @@ -359,11 +359,17 @@ var bitmask = function(){ * @param {string} address The email address of the key * @param {boolean} priv Should get the private key? * If it's not provided the public one will be fetched. + * @param {boolean} fetch If the key is not in keymanager, should we fetch it remotely. + * If it's not provided keys will not be fetched remotely * * @return {Promise} The key */ - exprt: function(uid, address, priv) { - return call(['keys', 'export', uid, address, private_str(priv)]); + exprt: function(uid, address, priv, fetch) { + var privstr = private_str(priv); + if ((typeof fetch === 'bool') && fetch) { + privstr = 'fetch'; + } + return call(['keys', 'export', uid, address, privstr]); }, /** -- cgit v1.2.3