do not use promisifygunnode
This commit is contained in:
parent
ed3e343e0e
commit
82a55c5091
1 changed files with 13 additions and 4 deletions
|
|
@ -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 => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue