Skip to content
Snippets Groups Projects
Unverified Commit 942d8803 authored by Diego Sampaio's avatar Diego Sampaio
Browse files

Show a desktop notification only for the opened room if on embedded mode

parent 94ec9007
No related branches found
No related tags found
No related merge requests found
......@@ -3,11 +3,8 @@
# group messages in which the user is mentioned.
Meteor.startup ->
Tracker.autorun ->
if Meteor.userId()
RocketChat.Notifications.onUser 'notification', (notification) ->
openedRoomId = undefined
......@@ -23,9 +20,12 @@ Meteor.startup ->
fromOpenedRoom: messageIsInOpenedRoom
hasFocus: hasFocus
if !(hasFocus and messageIsInOpenedRoom)
# Play a sound.
if RocketChat.Layout.isEmbedded()
if !hasFocus and messageIsInOpenedRoom
# Play a sound and show a notification.
KonchatNotification.newMessage()
KonchatNotification.showDesktop notification
else if !(hasFocus and messageIsInOpenedRoom)
# Play a sound and show a notification.
KonchatNotification.newMessage()
# Show a notification.
KonchatNotification.showDesktop notification
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