mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
fix mark all read
This commit is contained in:
@@ -97,7 +97,7 @@ SocketTopics.postcount = function(socket, tid, callback) {
|
||||
};
|
||||
|
||||
SocketTopics.markAsRead = function(socket, tids, callback) {
|
||||
if(!Array.isArray(tids) || !socket.uid) {
|
||||
if (!Array.isArray(tids) || !socket.uid) {
|
||||
return callback(new Error('[[error:invalid-data]]'));
|
||||
}
|
||||
|
||||
@@ -123,14 +123,14 @@ SocketTopics.markAsRead = function(socket, tids, callback) {
|
||||
};
|
||||
|
||||
SocketTopics.markTopicNotificationsRead = function(socket, tid, callback) {
|
||||
if(!tid || !socket.uid) {
|
||||
if (!tid || !socket.uid) {
|
||||
return callback(new Error('[[error:invalid-data]]'));
|
||||
}
|
||||
topics.markTopicNotificationsRead(tid, socket.uid);
|
||||
};
|
||||
|
||||
SocketTopics.markAllRead = function(socket, data, callback) {
|
||||
topics.getLatestTidsFromSet('topics:recent', 0, -1, 'day', function(err, tids) {
|
||||
db.getSortedSetRevRangeByScore('topics:recent', 0, -1, '+inf', Date.now() - topics.unreadCutoff, function(err, tids) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user