filter out yourself from users online list

This commit is contained in:
Faye Li 2017-02-10 16:22:30 -08:00
parent 91bfa65fe2
commit 8f43ceed9d

View file

@ -345,6 +345,12 @@
}
function processData(data, type) {
// Filter out yourself from the users list
var removeIndex = data.users.map(function(user) { return user.username }).indexOf(myUsername);
if (removeIndex >= 0) {
data.users.splice(removeIndex,1);
}
var num = data.users.length;
if (type === "everyone") {
$(".tabs li:nth-child(1)").text("Everyone (" + num + ")");