diff --git a/services/gunDB/contact-api/actions.js b/services/gunDB/contact-api/actions.js index 2f490d5a..25b98004 100644 --- a/services/gunDB/contact-api/actions.js +++ b/services/gunDB/contact-api/actions.js @@ -1513,7 +1513,7 @@ const initWall = async () => { user .get(Key.WALL) .get(Key.NUM_OF_PAGES) - .put(1, ack => { + .put(0, ack => { if (ack.err) { rej(new Error(ack.err)) } else { diff --git a/services/gunDB/contact-api/getters/wall.js b/services/gunDB/contact-api/getters/wall.js index 73eb210f..83cdb5a7 100644 --- a/services/gunDB/contact-api/getters/wall.js +++ b/services/gunDB/contact-api/getters/wall.js @@ -44,6 +44,13 @@ const getWallPage = async (page, publicKey) => { ) } + if (totalPages === 0) { + return { + count: 0, + posts: {} + } + } + const actualPageIdx = page < 0 ? totalPages + page : page - 1 if (actualPageIdx > totalPages - 1) {