From 00c73902065147e4d6223643f3a80f0ec1b58b2f Mon Sep 17 00:00:00 2001 From: Ev Bogue Date: Wed, 1 May 2019 21:14:40 -0500 Subject: no need to pass timestamp to publish, return getName to working order --- bog.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bog.js b/bog.js index 63ec9be..072326c 100644 --- a/bog.js +++ b/bog.js @@ -59,6 +59,14 @@ function getName (id) { name.textContent = id.substring(0, 10) + '...' + bog().then(log => { + log.forEach(function (msg) { + if (msg.named == id) { + return name.textContent = '@' + msg.name + } + }) + }) + return name } @@ -83,8 +91,12 @@ async function bog (feed) { async function publish (post, keys) { post.author = keys.publicKey - var message = { author: keys.publicKey } + post.timestamp = Date.now() + var message = { + author: keys.publicKey + } + var feed = await localforage.getItem(keys.publicKey) if (feed) { -- cgit v1.2.3-70-g09d2