From adc8ba42a0fed3b35d80ea16404e83e38d0d388f Mon Sep 17 00:00:00 2001 From: Phillip Date: Sat, 13 May 2023 03:33:18 +0300 Subject: [PATCH] added to multiple --- plugins/plugins/core/qdn/browser/browser.src.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/plugins/core/qdn/browser/browser.src.js b/plugins/plugins/core/qdn/browser/browser.src.js index f04aa31c..9889d87e 100644 --- a/plugins/plugins/core/qdn/browser/browser.src.js +++ b/plugins/plugins/core/qdn/browser/browser.src.js @@ -1007,9 +1007,9 @@ class WebBrowser extends LitElement { response = JSON.stringify(data); break } - if (data.encrypt && !data.recipientPublicKey) { + if (data.encrypt && (!data.publicKeys || (Array.isArray(data.publicKeys) && data.publicKeys.length === 0))) { let data = {}; - data['error'] = "Encrypting data requires the recipient's public key"; + data['error'] = "Encrypting data requires public keys"; response = JSON.stringify(data); break } @@ -1068,13 +1068,14 @@ class WebBrowser extends LitElement { throw new Error("Only encrypted data can go into private services") } + if (data.encrypt) { try { - const encryptDataResponse = encryptData({ - data64, recipientPublicKey: data.recipientPublicKey + const encryptDataResponse = encryptDataGroup({ + data64, publicKeys: data.publicKeys }) - if (encryptDataResponse.encryptedData) { - data64 = encryptDataResponse.encryptedData + if (encryptDataResponse) { + data64 = encryptDataResponse } } catch (error) {