From 639247a8b0b9919049c91f8865d0ee75599fa77b Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Wed, 4 Dec 2013 18:58:20 -0500 Subject: [PATCH] fixed notifications --- src/notifications.js | 3 +-- src/user.js | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) 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 {