aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEv Bogue <ev@evbogue.com>2019-05-01 21:14:40 -0500
committerEv Bogue <ev@evbogue.com>2019-05-01 21:14:40 -0500
commit00c73902065147e4d6223643f3a80f0ec1b58b2f (patch)
treebb4fab8ba68a6ed8b1a67219b28efaae3f277c89
parentb11e664970b0456d5e48f884f0b06975dd23fd8b (diff)
no need to pass timestamp to publish, return getName to working order
-rw-r--r--bog.js14
1 files changed, 13 insertions, 1 deletions
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) {