From 39c01733d7a58a452b4f5798a8f019c8d5882748 Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Thu, 25 Jun 2020 19:03:34 -0400 Subject: [PATCH] better initialization --- services/gunDB/contact-api/actions.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/services/gunDB/contact-api/actions.js b/services/gunDB/contact-api/actions.js index cfdd96fa..ab7d6955 100644 --- a/services/gunDB/contact-api/actions.js +++ b/services/gunDB/contact-api/actions.js @@ -1301,14 +1301,21 @@ const createPost = async (tags, title, content) => { .get(Key.WALL) .get(Key.PAGES) .get(pageIdx) - .get(Key.COUNT) - .put(shouldBeNewPage ? 1 : count + 1, ack => { - if (ack.err) { - throw new Error(ack.err) - } + .put( + { + [Key.COUNT]: shouldBeNewPage ? 1 : count + 1, + posts: { + unused: null + } + }, + ack => { + if (ack.err) { + throw new Error(ack.err) + } - res() - }) + res() + } + ) }) /** @type {string} */