-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] Fix new room sound being played too much #8144
Conversation
@@ -1,14 +1,6 @@ | |||
/* globals menu*/ | |||
|
|||
Template.sideNav.helpers({ | |||
hasUnread() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used helpers 🤷♂️
You rule! This was getting super annoying! Like it was sitting there demanding I pay it attention everytime the other person started typing or anything until I finally looked at it |
94f994e
to
096672e
Compare
client/notifications/notification.js
Outdated
@@ -55,6 +55,17 @@ Meteor.startup(function() { | |||
KonchatNotification.newMessage(notification.payload.rid); | |||
} | |||
}); | |||
|
|||
RocketChat.Notifications.onUser('subscriptions-changed', function(action, sub) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when you was added while offline and open the chat after that in a new window? You will receive the subscriptions in another place, it will not be an change while logged in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm looking into it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
covered by dc0aa06 =)
[FIX] Fix new room sound being played too much
@RocketChat/core
I removed logic from the template to a listener on the
subscription-changed
stream, so the sound will play only when new data comes from server and not due to any random reactivity.I've also removed some calls to
Meteor.user()
which adds reactivity to changes to any field of the current user, which was not desired, and replaced byMeteor.userId()
(when the test was to see the user is logged in) and by a query on specific fields (this way if I care aboutsettings
field my code will not reactivity ran if thestatus
field changes).