From 462de772ed178e879d70a437689893ff60d1f99e Mon Sep 17 00:00:00 2001 From: cel Date: Mon, 18 Jun 2018 12:52:26 -0400 Subject: Show follow/block counts --- lib/render.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'lib') 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) + ' ') + } + }) + } + } ) } -- cgit v1.2.3