Skip to content

Node.js based forum software built for the modern web

fixed notifications

Baris Soner Usakli639247a8b0b9
diff --git a/src/notifications.js b/src/notifications.js
index a75de443c4..1c2a139252 100644
--- a/src/notifications.js
+++ b/src/notifications.js
@@ -19,8 +19,7 @@ var async = require('async'),
Notifications.get = function(nid, uid, callback) {
- db.exists('nofitications:' + nid, function(err, exists) {
-
+ db.exists('notifications:' + nid, function(err, exists) {
if(!exists) {
return callback(null);
}
diff --git a/src/user.js b/src/user.js
index 7770f8862d..74c370d149 100644
--- a/src/user.js
+++ b/src/user.js
@@ -1039,8 +1039,12 @@ var bcrypt = require('bcrypt'),
},
getUnreadByUniqueId: function(uid, uniqueId, callback) {
db.getSortedSetRange('uid:' + uid + ':notifications:unread', 0, -1, function(err, nids) {
+
async.filter(nids, function(nid, next) {
notifications.get(nid, uid, function(notifObj) {
+ if(!notifObj) {
+ next(false);
+ }
if (notifObj.uniqueId === uniqueId) {
next(true);
} else {