mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
fix project results order, sort by time
This commit is contained in:
parent
3ab8238013
commit
8615b7a086
1 changed files with 6 additions and 3 deletions
|
@ -154,6 +154,9 @@ module.exports = MongoPackManager =
|
||||||
return false if cutoff? && ts < cutoff
|
return false if cutoff? && ts < cutoff
|
||||||
return true
|
return true
|
||||||
|
|
||||||
|
timeOrder = (a, b) ->
|
||||||
|
b.meta.end_ts - a.meta.end_ts
|
||||||
|
|
||||||
updates = MongoPackManager._filterAndLimit(updates, unpackedSet, filterFn, limit)
|
updates = MongoPackManager._filterAndLimit(updates, unpackedSet, filterFn, limit)
|
||||||
#console.log 'initial updates are', updates
|
#console.log 'initial updates are', updates
|
||||||
|
|
||||||
|
@ -210,15 +213,15 @@ module.exports = MongoPackManager =
|
||||||
|
|
||||||
tail.toArray (err, result2) ->
|
tail.toArray (err, result2) ->
|
||||||
if err?
|
if err?
|
||||||
return callback err, updates
|
return callback err, updates.sort timeOrder
|
||||||
else
|
else
|
||||||
applyAndUpdate result2
|
applyAndUpdate result2
|
||||||
overlap.toArray (err, result3) ->
|
overlap.toArray (err, result3) ->
|
||||||
if err?
|
if err?
|
||||||
return callback err, updates
|
return callback err, updates.sort timeOrder
|
||||||
else
|
else
|
||||||
applyAndUpdate result3
|
applyAndUpdate result3
|
||||||
callback err, updates
|
callback err, updates.sort timeOrder
|
||||||
|
|
||||||
_unpackResults: (updates) ->
|
_unpackResults: (updates) ->
|
||||||
# iterate over the updates, if there's a pack, expand it into ops and
|
# iterate over the updates, if there's a pack, expand it into ops and
|
||||||
|
|
Loading…
Reference in a new issue