Allow ability to hide the number of visitors

This commit is contained in:
Robbie Antenesse 2019-01-04 15:47:44 -07:00
parent 6d0a37dd70
commit 6359d8ba33
3 changed files with 10 additions and 5 deletions

BIN
README.md

Binary file not shown.

View File

@ -244,8 +244,10 @@ function Server () {
});
this.io.on('connection', socket => {
this.connections++;
this.io.emit('update visitors', this.connections);
if (!settings.hideVisitors) {
this.connections++;
this.io.emit('update visitors', this.connections);
}
socket.on('take book', bookId => {
const fileLocation = this.takeBook(bookId, socket.id);
@ -258,8 +260,10 @@ function Server () {
});
socket.on('disconnect', () => {
this.connections--;
this.io.emit('update visitors', this.connections);
if (!settings.hideVisitors) {
this.connections--;
this.io.emit('update visitors', this.connections);
}
this.deleteBooks(socket.id);
});
});

View File

@ -8,5 +8,6 @@
"maxFileSize": 0,
"maxHistory": 0,
"allowedFormats": [".epub", ".mobi", ".pdf"],
"backupPassword": "password"
"backupPassword": "password",
"hideVisitors": false
}