do not use promisifygunnode

This commit is contained in:
Daniel Lugo 2020-06-24 13:37:42 +01:00
parent ed3e343e0e
commit 82a55c5091

View file

@ -1310,10 +1310,19 @@ const createPost = async (tags, title, content) => {
const contentItems = post.get(Key.CONTENT_ITEMS) const contentItems = post.get(Key.CONTENT_ITEMS)
await Promise.all( await Promise.all(
content.map(ci => { content.map(
ci =>
new Promise(res => {
// @ts-ignore // @ts-ignore
return Utils.promisifyGunNode(contentItems).set(ci) contentItems.set(ci, ack => {
if (ack.err) {
throw new Error(ack.err)
}
res()
}) })
})
)
) )
const loadedPost = await new Promise(res => { const loadedPost = await new Promise(res => {