aboutsummaryrefslogtreecommitdiff
path: root/bog.js
diff options
context:
space:
mode:
Diffstat (limited to 'bog.js')
-rw-r--r--bog.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/bog.js b/bog.js
index 2ce37bb..49d0b52 100644
--- a/bog.js
+++ b/bog.js
@@ -81,7 +81,6 @@ async function unbox (boxed, sender, keys) {
return message
}
-
// bog.get -- iterates over log and returns a post.
// EX: get('%x5T7KZ5haR2F59ynUuCggwEdFXlLHEtFoBQIyKYppZYerq9oMoIqH76YzXQpw2DnYiM0ugEjePXv61g3E4l/Gw==').then(msg => { console.log(msg)})
@@ -140,6 +139,7 @@ function getName (id, keys) {
localforage.getItem('name:' + id).then(cache => {
if (cache) {
+ console.log(cache)
return name.textContent = '@' + cache
} else {
bog().then(log => {
@@ -163,6 +163,16 @@ function getName (id, keys) {
return name
}
+async function quickName (id, keys) {
+ var cache = await localforage.getItem('name:' + id)
+
+ if (cache) {
+ return '@' + cache
+ } else {
+ return id.substring(0, 10)
+ }
+}
+
// bog.regenerate -- regenerates main log by taking all of the feed logs, combinging them, and then sorting them
function regenerate (home) {
@@ -201,7 +211,6 @@ function regenerate (home) {
// EX: bog().then(log => { console.log(log)})
// EX: bog('@ExE3QXmBhYQlGVA3WM2BD851turNzwhruWbIpMd7rbQ=').then(log => { console.log(log)})
-
async function bog (feed) {
if (feed) {
var log = await localforage.getItem(feed)