Compare commits

...

2 Commits

Author SHA1 Message Date
Julian Lam
dc6fc65322 chore: bump version 2021-03-24 12:56:05 -04:00
Barış Soner Uşaklı
27b481765b fix: #9420, paginate after loading notifications 2021-03-24 12:54:47 -04:00
2 changed files with 7 additions and 6 deletions

View File

@@ -2,7 +2,7 @@
"name": "nodebb",
"license": "GPL-3.0",
"description": "NodeBB Forum",
"version": "1.16.2-beta.0",
"version": "1.16.2-beta.1",
"homepage": "http://www.nodebb.org",
"repository": {
"type": "git",
@@ -190,4 +190,4 @@
"url": "https://github.com/barisusakli"
}
]
}
}

View File

@@ -51,11 +51,12 @@ notificationsController.get = async function (req, res, next) {
if (!selectedFilter) {
return next();
}
let nids = await user.notifications.getAll(req.uid, selectedFilter.filter);
const pageCount = Math.max(1, Math.ceil(nids.length / itemsPerPage));
nids = nids.slice(start, stop + 1);
const notifications = await user.notifications.getNotifications(nids, req.uid);
const nids = await user.notifications.getAll(req.uid, selectedFilter.filter);
let notifications = await user.notifications.getNotifications(nids, req.uid);
const pageCount = Math.max(1, Math.ceil(notifications.length / itemsPerPage));
notifications = notifications.slice(start, stop + 1);
res.render('notifications', {
notifications: notifications,