From fafc524c8c97620e100577d9bd82d03295b7c8f5 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Fri, 31 Dec 2021 00:57:57 +0000 Subject: [PATCH] Just messing around with things. Not sure I've made anything better. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3722 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- apps/cory/index.json | 2 +- apps/cory/index/app.js | 56 ++++++++++++++++++++------------------ apps/cory/index/tf-user.js | 28 ++++++++++++------- 3 files changed, 48 insertions(+), 38 deletions(-) diff --git a/apps/cory/index.json b/apps/cory/index.json index 40411dd5..e24d0182 100644 --- a/apps/cory/index.json +++ b/apps/cory/index.json @@ -1 +1 @@ -{"type":"tildefriends-app","files":{"app.js":"&bKoyBQBiMZinCQUoQIqGpeehKgqkANw8Ns2OYECYW30=.sha256","index.html":"&zwiRwroNQ1SnCsq97zB8dRiGwY4H+ii4ZtuKR385zdI=.sha256","vue-material.js":"&K5cdLqXYCENPak/TCINHQhyJhpS4G9DlZHGwoh/LF2g=.sha256","tf-user.js":"&taC9THJslxAMy72UIplFjALJx1VHv2l+qfjWoRhhrS4=.sha256","tf-message.js":"&KjVh7zASx0TZtZTsS6lJ7T70K9tyXcf+ink4vK7gSWI=.sha256","tf.js":"&u6n7Eqa1ryFuL9AhlYeJ/WzXYh6zxECKVfhG8/ecRM8=.sha256","commonmark.min.js":"&5x6ek3tFrKTZX6hXNNyFsjmhvrjmWpUkwuuaiyVV1Us=.sha256","vue.js":"&g1wvA+yHl1sVC+eufTsg9If7ZeVyMTBU+h0tks7ZNzE=.sha256","vue-material-theme-default-dark.css":"&RP2nr+2CR18BpHHw5ST9a5GJUCOG9n0G2kuGkcQioWE=.sha256","vue-material.min.css":"&kGbUM2QgFSyHZRzqQb0b+0S3EVIlZ0AXpdiAVjIhou8=.sha256","roboto.css":"&jJv43Om673mQO5JK0jj7714s5E+5Yrf82H6LcDx7wUs=.sha256","material-icons.css":"&a28PdcVvgq/DxyIvJAx/e+ZOEtOuHnr3kjLWKyzH11M=.sha256"}} \ No newline at end of file +{"type":"tildefriends-app","files":{"app.js":"&bbZBdFOrGh6o0X+ypAaRhfAls89Ir/IICcUN3xlO02w=.sha256","index.html":"&zwiRwroNQ1SnCsq97zB8dRiGwY4H+ii4ZtuKR385zdI=.sha256","vue-material.js":"&K5cdLqXYCENPak/TCINHQhyJhpS4G9DlZHGwoh/LF2g=.sha256","tf-user.js":"&KmUw2D8yehJU95RQ+8DWP69w/5wK7yWR6fUc5/LIpio=.sha256","tf-message.js":"&KjVh7zASx0TZtZTsS6lJ7T70K9tyXcf+ink4vK7gSWI=.sha256","tf.js":"&u6n7Eqa1ryFuL9AhlYeJ/WzXYh6zxECKVfhG8/ecRM8=.sha256","commonmark.min.js":"&5x6ek3tFrKTZX6hXNNyFsjmhvrjmWpUkwuuaiyVV1Us=.sha256","vue.js":"&g1wvA+yHl1sVC+eufTsg9If7ZeVyMTBU+h0tks7ZNzE=.sha256","vue-material-theme-default-dark.css":"&RP2nr+2CR18BpHHw5ST9a5GJUCOG9n0G2kuGkcQioWE=.sha256","vue-material.min.css":"&kGbUM2QgFSyHZRzqQb0b+0S3EVIlZ0AXpdiAVjIhou8=.sha256","roboto.css":"&jJv43Om673mQO5JK0jj7714s5E+5Yrf82H6LcDx7wUs=.sha256","material-icons.css":"&a28PdcVvgq/DxyIvJAx/e+ZOEtOuHnr3kjLWKyzH11M=.sha256"}} \ No newline at end of file diff --git a/apps/cory/index/app.js b/apps/cory/index/app.js index f0fe138e..ff1ea8b8 100644 --- a/apps/cory/index/app.js +++ b/apps/cory/index/app.js @@ -273,33 +273,35 @@ async function refresh() { app.postMessage({connections: await ssb.connections()}), app.postMessage({apps: await core.apps()}), followingDeep(db, [whoami], 2).then(function(f) { - getRecentPostIds(db, whoami, [].concat([whoami], f), k_posts_max).then(async function(ids) { - return getPosts(db, ids); - }).then(async function(posts) { - var roots = posts.map(function(x) { - try { - return JSON.parse(x.content).root; - } catch { - return null; - } - }); - roots = roots.filter(function(root) { - return root && posts.every(post => post.id != root); - }); - return [].concat(posts, await getPosts(db, roots)); - }).then(function(posts) { - return Promise.all(posts.map(x => app.postMessage({message: x}))); - }); - Promise.all(f.map(function(id) { - return Promise.all([ - getVotes(db, id).then(function(votes) { - return app.postMessage({votes: votes}); - }), - getAbout(db, id).then(function(user) { - return app.postMessage({user: {user: id, about: user}}); - }), - ]); - })); + return Promise.all([ + getRecentPostIds(db, whoami, [].concat([whoami], f), k_posts_max).then(async function(ids) { + return getPosts(db, ids); + }).then(async function(posts) { + var roots = posts.map(function(x) { + try { + return JSON.parse(x.content).root; + } catch { + return null; + } + }); + roots = roots.filter(function(root) { + return root && posts.every(post => post.id != root); + }); + return [].concat(posts, await getPosts(db, roots)); + }).then(function(posts) { + return Promise.all(posts.map(x => app.postMessage({message: x}))); + }), + Promise.all(f.map(function(id) { + return Promise.all([ + getVotes(db, id).then(function(votes) { + return app.postMessage({votes: votes}); + }), + getAbout(db, id).then(function(user) { + return app.postMessage({user: {user: id, about: user}}); + }), + ]); + })), + ]); }), sendUser(db, whoami), ]); diff --git a/apps/cory/index/tf-user.js b/apps/cory/index/tf-user.js index 1613bd10..bdae44f8 100644 --- a/apps/cory/index/tf-user.js +++ b/apps/cory/index/tf-user.js @@ -78,16 +78,24 @@ Vue.component('tf-user', {
{{id}}
{{users[id].description}}
Following
- - Followers - - - - Following - - - - +
+
+ + Followers + + + + +
+
+ + Following + + + + +
+