Skip to content
This repository has been archived by the owner on Oct 17, 2022. It is now read-only.

Commit

Permalink
use real timestamp sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
tycrek committed Jul 13, 2021
1 parent 958b81f commit 744061b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion router.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ router.get('/user', async (req, res, next) => {
pages: req.pages,
brand: FRONTEND_BRAND_COMBO,
user: users[activeTokens[req.session.token]],
uploads: uploads.reverse().slice(req.pages.pagination, req.pages.pagination + PAGE_SIZE),
uploads: uploads.sort(([, a], [, b]) => b.timestamp - a.timestamp).slice(req.pages.pagination, req.pages.pagination + PAGE_SIZE),
totalUploads: uploads.length
}))
.catch(next);
Expand Down

0 comments on commit 744061b

Please sign in to comment.