mirror of
https://github.com/darkwire/darkwire.io.git
synced 2025-07-23 12:56:57 +00:00
Don't show user as joined until they enter a key
This commit is contained in:
parent
83df79de29
commit
fd84a4ef8d
@ -518,6 +518,7 @@ $(function() {
|
||||
if (!key.length) return;
|
||||
updateKeyVal(key);
|
||||
$('#join-modal').modal('hide');
|
||||
socket.emit('user joined');
|
||||
}
|
||||
|
||||
$('#settings-modal').on('hide.bs.modal', function (e) {
|
||||
|
@ -40,12 +40,15 @@ class Room {
|
||||
numUsers: this.numUsers,
|
||||
users: this.users
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('user joined', () => {
|
||||
// echo globally (all clients) that a person has connected
|
||||
socket.broadcast.emit('user joined', {
|
||||
username: socket.username,
|
||||
numUsers: this.numUsers,
|
||||
users: this.users
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// when the client emits 'typing', we broadcast it to others
|
||||
|
Loading…
x
Reference in New Issue
Block a user