aboutsummaryrefslogtreecommitdiff
path: root/lib/serve.js
diff options
context:
space:
mode:
authorcel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519>2020-03-23 15:13:58 -0400
committercel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519>2020-03-28 13:55:24 -0400
commite3e4ed19ef47bbbd8a0236011b5d4bf131eed048 (patch)
treee469ec3262387a7ed6c2f4d6b324ebbe1d014cef /lib/serve.js
parent661eff54f83248fe168f066648b88112109e1e29 (diff)
downloadpatchfoo-e3e4ed19ef47bbbd8a0236011b5d4bf131eed048.tar.gz
patchfoo-e3e4ed19ef47bbbd8a0236011b5d4bf131eed048.zip
Fix sorting by claimed timestamp
Diffstat (limited to 'lib/serve.js')
-rw-r--r--lib/serve.js3
1 files changed, 3 insertions, 0 deletions
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,