aboutsummaryrefslogtreecommitdiff
path: root/lib/serve.js
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-05-16 14:27:02 -0400
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-05-16 14:27:02 -0400
commitf0952377664cc671d536cff9d13918e967964e04 (patch)
treeb8fe77f2ceda80c0cd790f7bb2b26520613939a8 /lib/serve.js
parentdf3ff8760da8e958fcd40e187fbc0dc63e47a5d0 (diff)
downloadpatchfoo-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.js6
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 :