Skip to content
Snippets Groups Projects
Commit 7d8aae9c authored by lazorfuzz's avatar lazorfuzz
Browse files

Fix existing room check

parent e4494a6d
No related branches found
No related tags found
No related merge requests found
...@@ -97,13 +97,14 @@ export default (server, config) => { ...@@ -97,13 +97,14 @@ export default (server, config) => {
name = uuid(); name = uuid();
} }
// check if exists // check if exists
const room = io.nsps['/'].adapter.rooms[name]; io.in(name).clients((err, clients) => {
if (room && room.length) { if (clients && clients.length) {
safeCb(cb)('taken'); safeCb(cb)('taken');
} else { } else {
join(name); join(name);
safeCb(cb)(null, name); safeCb(cb)(null, name);
} }
});
}); });
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment