Skip to content

Commit

Permalink
fix realtime duplicate events
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamqweasd committed Nov 9, 2017
1 parent d9cfa45 commit 69add80
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions database-connect/realTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ module.exports = function (io) {
var roomSockets = io.to(data.channel);
var sockets = roomSockets.sockets;

if (typeof sockets === "object") {
for (var key in sockets) {
if (sockets[key]) {
sockets[key].emit(data.channel, data.data);
}
}
}
// if (typeof sockets === "object") {
// for (var key in sockets) {
// if (sockets[key]) {
// sockets[key].emit(data.channel, data.data);
// }
// }
// }

io.emit(data.channel, data.data);

Expand Down

0 comments on commit 69add80

Please sign in to comment.