fix: unread badge

- only increase unread badge if topic or category is watched
- fix logic for "there are new posts/topics" on /unread and /recent
This commit is contained in:
Barış Soner Uşaklı
2018-12-15 16:38:30 -05:00
parent d2c2d56f59
commit 9f5062682d
8 changed files with 81 additions and 73 deletions

View File

@@ -161,7 +161,7 @@ topicsController.get = function (req, res, callback) {
res.locals.linkTags.push(rel);
});
if (!req.isSpider()) {
if (req.uid >= 0) {
req.session.tids_viewed = req.session.tids_viewed || {};
if (!req.session.tids_viewed[tid] || req.session.tids_viewed[tid] < Date.now() - 3600000) {
topics.increaseViewCount(tid);