aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-06-18 12:52:26 -0400
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-06-18 12:52:26 -0400
commit462de772ed178e879d70a437689893ff60d1f99e (patch)
treeec972aeb77f93dc9dc2e81057be20d968954b8d5 /lib
parent7793a1d33d0e76b7ae7490a974f5f171520b94d7 (diff)
downloadpatchfoo-462de772ed178e879d70a437689893ff60d1f99e.tar.gz
patchfoo-462de772ed178e879d70a437689893ff60d1f99e.zip
Show follow/block counts
Diffstat (limited to 'lib')
-rw-r--r--lib/render.js21
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/render.js b/lib/render.js
index 7593e41..0d83f75 100644
--- a/lib/render.js
+++ b/lib/render.js
@@ -592,10 +592,21 @@ Render.prototype.friendsList = function (prefix) {
cb(null, h('a', {href: self.toUrl(prefix + id)}, name))
})
}, 8),
- pull.map(function (el) {
- return [el, ' ']
- }),
- pull.flatten(),
- pull.map(u.toHTML)
+ function (read) {
+ var count = 0
+ var ended
+ return function (abort, cb) {
+ if (ended) return cb(ended)
+ read(abort, function (end, el) {
+ if (end === true) {
+ ended = true
+ cb(null, '(' + count + ')')
+ } else {
+ count++
+ cb(end, u.toHTML(el) + ' ')
+ }
+ })
+ }
+ }
)
}