From b9b02a1fabd26e1e50366ef4598fdaf5f07f9ad6 Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Thu, 25 May 2017 14:40:18 -0400 Subject: [PATCH] math.ceil pageCount --- src/controllers/accounts/notifications.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/accounts/notifications.js b/src/controllers/accounts/notifications.js index 9e1839b42b..c6715ba144 100644 --- a/src/controllers/accounts/notifications.js +++ b/src/controllers/accounts/notifications.js @@ -70,7 +70,7 @@ notificationsController.get = function (req, res, next) { user.notifications.getAll(req.uid, selectedFilter.filter, _next); }, function (nids, next) { - pageCount = nids.length / itemsPerPage; + pageCount = Math.max(1, Math.ceil(nids.length / itemsPerPage)); nids = nids.slice(start, stop + 1); user.notifications.getNotifications(nids, req.uid, next);