diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2018-05-16 14:27:02 -0400 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2018-05-16 14:27:02 -0400 |
commit | f0952377664cc671d536cff9d13918e967964e04 (patch) | |
tree | b8fe77f2ceda80c0cd790f7bb2b26520613939a8 /lib/serve.js | |
parent | df3ff8760da8e958fcd40e187fbc0dc63e47a5d0 (diff) | |
download | patchfoo-f0952377664cc671d536cff9d13918e967964e04.tar.gz patchfoo-f0952377664cc671d536cff9d13918e967964e04.zip |
Attempt to fix pagination issues
- Filter messages before passing them to paginate function,
so that the paginate function picks the correct one as the last one.
- Remove obsolete lt/gt hack
- Try to handle sortByTimestamp for /mentions
TODO: avoid calling filterMsg multiple times per message
Diffstat (limited to 'lib/serve.js')
-rw-r--r-- | lib/serve.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/serve.js b/lib/serve.js index 9b4dcd4..e9b8f2b 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -1343,6 +1343,12 @@ Serve.prototype.renderThreadPaginated = function (opts, feedId, q) { } return pull( + self.app.filterMessages({ + feed: opts && opts.feed, + msgId: opts && opts.msgId, + filter: this.query.filter, + limit: Number(this.query.limit) || 12, + }), paginate( function onFirst(msg, cb) { var num = feedId ? msg.value.sequence : |