mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-12-08 20:48:48 +00:00
Fixed issue with viewercounter being below 0
This commit is contained in:
@@ -124,7 +124,7 @@ module.exports = function() {
|
||||
}, function(err, updated) {
|
||||
if(updated.nModified > 0) {
|
||||
io.to(coll).emit("viewers", updated.users);
|
||||
db.collection("connected_users").update({"_id": "total_users"}, {$inc: {total_users: -1}}, function(err, docs){
|
||||
db.collection("connected_users").update({"_id": "total_users", total_users: {$gt: 0}}, {$inc: {total_users: -1}}, function(err, docs){
|
||||
db.collection("connected_users").update({"_id": "offline_users"}, {$addToSet: {users: guid}}, function(err, docs) {
|
||||
if(docs.nModified == 1) {
|
||||
db.collection("connected_users").update({"_id": "total_users"}, {$inc: {total_users: 1}}, function(err, docs) {});
|
||||
|
||||
Reference in New Issue
Block a user