fix: return early if there are not blocked uids

This commit is contained in:
Baris Usakli
2019-03-12 14:02:07 -04:00
parent 802931465e
commit 73d14e4516

View File

@@ -295,7 +295,9 @@ module.exports = function (Topics) {
var count = 3;
var done = false;
var hasUnblockedUnread = params.topicTimestamp > userLastReadTimestamp;
if (!params.blockedUids.length) {
return setImmediate(callback, null, hasUnblockedUnread);
}
async.whilst(function () {
return !done;
}, function (_next) {