From e3e4ed19ef47bbbd8a0236011b5d4bf131eed048 Mon Sep 17 00:00:00 2001 From: cel Date: Mon, 23 Mar 2020 15:13:58 -0400 Subject: Fix sorting by claimed timestamp --- lib/serve.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/serve.js') diff --git a/lib/serve.js b/lib/serve.js index 685faa6..d780024 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -644,6 +644,7 @@ Serve.prototype.new = function (ext) { Serve.prototype.private = function (ext) { var q = this.query var opts = { + sortByTimestamp: q.sort === 'claimed', reverse: !q.forwards, lt: Number(q.lt) || Date.now(), gt: Number(q.gt) || -Infinity, @@ -1764,6 +1765,7 @@ Serve.prototype.type = function (path) { var q = this.query var type = decodeURIComponent(path.substr(1)) var opts = { + sortByTimestamp: q.sort === 'claimed', reverse: !q.forwards, lt: Number(q.lt) || Date.now(), gt: Number(q.gt) || -Infinity, @@ -1829,6 +1831,7 @@ Serve.prototype.channel = function (path) { var gt = Number(q.gt) || -Infinity var lt = Number(q.lt) || Date.now() var opts = { + sortByTimestamp: q.sort === 'claimed', reverse: !q.forwards, lt: lt, gt: gt, -- cgit v1.2.3