aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/serve.js33
1 files changed, 18 insertions, 15 deletions
diff --git a/lib/serve.js b/lib/serve.js
index b394f39..ec63b59 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -551,6 +551,7 @@ Serve.prototype.userFeed = function (id, ext) {
gt: Number(q.gt) || -Infinity,
limit: Number(q.limit) || 20
}
+ var isScrolled = q.lt || q.gt
self.app.getAbout(id, function (err, about) {
if (err) self.app.error(err)
@@ -558,7 +559,7 @@ Serve.prototype.userFeed = function (id, ext) {
self.app.sbot.createUserStream(opts),
self.renderThreadPaginated(opts, id, q),
self.wrapMessages(),
- self.wrapUserFeed(id),
+ self.wrapUserFeed(isScrolled, id),
self.wrapPage(about.name || id),
self.respondSink(200, {
'Content-Type': ctype(ext)
@@ -826,12 +827,12 @@ Serve.prototype.friendList = function (friends, cb) {
return list
}
-Serve.prototype.wrapUserFeed = function (id) {
+Serve.prototype.wrapUserFeed = function (isScrolled, id) {
var self = this
return u.hyperwrap(function (thread, cb) {
var done = multicb({pluck: 1, spread: true})
self.app.getAbout(id, done())
- self.app.getFriendInfo(id, done())
+ if (!isScrolled) self.app.getFriendInfo(id, done())
done(function (err, about, info) {
if (err) return cb(err)
var done = multicb({pluck: 1, spread: true})
@@ -846,18 +847,20 @@ Serve.prototype.wrapUserFeed = function (id) {
about.description ? h('div',
{innerHTML: self.app.render.markdown(about.description)}) : ''
)),
- h('tr',
- h('td', 'Friends:'),
- h('td', self.friendList(info.friends, done()))
- ),
- h('tr',
- h('td', 'Follows:'),
- h('td', self.friendList(info.follows, done()))
- ),
- h('tr',
- h('td', 'Followers:'),
- h('td', self.friendList(info.followers, done()))
- )
+ isScrolled ? '' : [
+ h('tr',
+ h('td', 'friends:'),
+ h('td', self.friendList(info.friends, done()))
+ ),
+ h('tr',
+ h('td', 'follows:'),
+ h('td', self.friendList(info.follows, done()))
+ ),
+ h('tr',
+ h('td', 'followers:'),
+ h('td', self.friendList(info.followers, done()))
+ )
+ ]
)),
thread
])