Skip to content
Snippets Groups Projects
Commit cd9b6b2f authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

Fix error in msgTyping

parent 5c993f16
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@
if _.isEmpty usersTyping[room]?.users
usersTyping[room] = { users: {} }
stream.on room, (typing) ->
unless typing.username is Meteor.user()?.username
unless typing?.username is Meteor.user()?.username
if typing.start
users = usersTyping[room].users
users[typing.username] = Meteor.setTimeout ->
......@@ -41,7 +41,7 @@
renew = false
selfTyping.set true
stream.emit 'typing', { room: room, username: Meteor.user().username, start: true }
stream.emit 'typing', { room: room, username: Meteor.user()?.username, start: true }
clearTimeout timeouts[room]
timeouts[room] = Meteor.setTimeout ->
stop(room)
......@@ -53,7 +53,7 @@
if timeouts?[room]?
clearTimeout(timeouts[room])
timeouts[room] = null
stream.emit 'typing', { room: room, username: Meteor.user().username, stop: true }
stream.emit 'typing', { room: room, username: Meteor.user()?.username, stop: true }
get = (room) ->
dep.depend()
......
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