Skip to content

Commit 7ae896a

Browse files
[fix] Fix remoteJoin/remoteLeave methods (#201)
The callback was triggered before the socket has actually joined/left the room.
1 parent 1dc1a9b commit 7ae896a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -665,8 +665,7 @@ function adapter(uri, opts) {
665665

666666
var socket = this.nsp.connected[id];
667667
if (socket) {
668-
socket.join(room);
669-
if (fn) process.nextTick(fn.bind(null, null));
668+
socket.join(room, fn);
670669
return;
671670
}
672671

@@ -708,8 +707,7 @@ function adapter(uri, opts) {
708707

709708
var socket = this.nsp.connected[id];
710709
if (socket) {
711-
socket.leave(room);
712-
if (fn) process.nextTick(fn.bind(null, null));
710+
socket.leave(room, fn);
713711
return;
714712
}
715713

0 commit comments

Comments
 (0)