better initialization

This commit is contained in:
Daniel Lugo 2020-06-25 19:03:34 -04:00
parent 552e625e5f
commit 39c01733d7

View file

@ -1301,14 +1301,21 @@ const createPost = async (tags, title, content) => {
.get(Key.WALL) .get(Key.WALL)
.get(Key.PAGES) .get(Key.PAGES)
.get(pageIdx) .get(pageIdx)
.get(Key.COUNT) .put(
.put(shouldBeNewPage ? 1 : count + 1, ack => { {
if (ack.err) { [Key.COUNT]: shouldBeNewPage ? 1 : count + 1,
throw new Error(ack.err) posts: {
} unused: null
}
},
ack => {
if (ack.err) {
throw new Error(ack.err)
}
res() res()
}) }
)
}) })
/** @type {string} */ /** @type {string} */