From fcc1de962e71a663561e50ff28a3bbdf1dc9b897 Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Mon, 24 Feb 2020 18:20:27 -0400 Subject: [PATCH] Revert "use tryandwait()" This reverts commit 9a9ea5e7a2a1a1f12d03a6763e3d274fd6eeb3e9. --- services/gunDB/contact-api/utils/index.js | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/services/gunDB/contact-api/utils/index.js b/services/gunDB/contact-api/utils/index.js index 18e37bfe..c3039323 100644 --- a/services/gunDB/contact-api/utils/index.js +++ b/services/gunDB/contact-api/utils/index.js @@ -182,20 +182,11 @@ const successfulHandshakeAlreadyExists = async recipientPub => { * @returns {Promise} */ const recipientToOutgoingID = async recipientPub => { - const maybeEncryptedOutgoingID = await tryAndWait(async (_, user) => { - const oid = await user - .get(Key.RECIPIENT_TO_OUTGOING) - .get(recipientPub) - .then() - - if (typeof oid !== 'string' && oid !== null) { - throw new Error( - 'Expected outgoing id from recipient-to-outgoing-id map to be an string or null' - ) - } - - return oid - }) + const maybeEncryptedOutgoingID = await require('../../Mediator/index') + .getUser() + .get(Key.RECIPIENT_TO_OUTGOING) + .get(recipientPub) + .then() if (typeof maybeEncryptedOutgoingID === 'string') { const outgoingID = await require('../../Mediator/index').mySEA.decrypt(