From 82a55c5091ad7af15da92a43edfc533879682084 Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Wed, 24 Jun 2020 13:37:42 +0100 Subject: [PATCH] do not use promisifygunnode --- services/gunDB/contact-api/actions.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/services/gunDB/contact-api/actions.js b/services/gunDB/contact-api/actions.js index 4a8bfcf5..45be6a0a 100644 --- a/services/gunDB/contact-api/actions.js +++ b/services/gunDB/contact-api/actions.js @@ -1310,10 +1310,19 @@ const createPost = async (tags, title, content) => { const contentItems = post.get(Key.CONTENT_ITEMS) await Promise.all( - content.map(ci => { - // @ts-ignore - return Utils.promisifyGunNode(contentItems).set(ci) - }) + content.map( + ci => + new Promise(res => { + // @ts-ignore + contentItems.set(ci, ack => { + if (ack.err) { + throw new Error(ack.err) + } + + res() + }) + }) + ) ) const loadedPost = await new Promise(res => {