mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 19:15:58 +01:00 
			
		
		
		
	users.js fix
This commit is contained in:
		| @@ -8,7 +8,7 @@ define(['notifications', 'chat'], function(Notifications, Chat) { | ||||
| 	Chat.prepareDOM(); | ||||
| 	translator.prepareDOM(); | ||||
|  | ||||
| 	function updateUnreadCount(count) { | ||||
| 	function updateUnreadCount(err, count) { | ||||
| 		$('#unread-count').toggleClass('unread-count', count > 0); | ||||
| 		$('#unread-count').attr('data-content', count > 20 ? '20+' : count); | ||||
| 	} | ||||
|   | ||||
| @@ -83,7 +83,7 @@ define(function() { | ||||
| 		socket.on('user.isOnline', function(err, data) { | ||||
| 			if(getActiveSection() == 'online' && !loadingMoreUsers) { | ||||
| 				startLoading('users:online', 0, true); | ||||
| 				socket.emit('user.getOnlineAnonCount', {} , function(anonCount) { | ||||
| 				socket.emit('user.getOnlineAnonCount', {} , function(err, anonCount) { | ||||
| 					if(parseInt(anonCount, 10) > 0) { | ||||
| 						$('#users-container .anon-user').removeClass('hide'); | ||||
| 						$('#online_anon_count').html(anonCount); | ||||
|   | ||||
| @@ -117,12 +117,12 @@ SocketUser.getOnlineUsers = function(socket, data, callback) { | ||||
| }; | ||||
|  | ||||
| SocketUser.getOnlineAnonCount = function(socket, data, callback) { | ||||
| 	callback(module.parent.exports.getOnlineAnonCount()); | ||||
| 	callback(null, module.parent.exports.getOnlineAnonCount()); | ||||
| }; | ||||
|  | ||||
| SocketUser.getUnreadCount = function(socket, data, callback) { | ||||
| 	topics.getUnreadTids(socket.uid, 0, 19, function(err, tids) { | ||||
| 		callback(tids.length); | ||||
| 		callback(err, tids?tids.length:0); | ||||
| 	}); | ||||
| }; | ||||
|  | ||||
| @@ -135,13 +135,13 @@ SocketUser.loadMore = function(socket, data, callback) { | ||||
| 		end = start + 19; | ||||
|  | ||||
| 	user.getUsers(data.set, start, end, function(err, data) { | ||||
| 		if (err) { | ||||
| 			winston.err(err); | ||||
| 		} else { | ||||
| 			callback({ | ||||
| 		if(err) { | ||||
| 			return callback(err); | ||||
| 		} | ||||
|  | ||||
| 		callback(null, { | ||||
| 			users: data | ||||
| 		}); | ||||
| 		} | ||||
| 	}); | ||||
| }; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user