Skip to content
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

Merged
merged 3 commits into from
Sep 16, 2017
Merged

Conversation

sampaiodiego
Copy link
Member

@sampaiodiego sampaiodiego commented Sep 14, 2017

@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 by Meteor.userId() (when the test was to see the user is logged in) and by a query on specific fields (this way if I care about settings field my code will not reactivity ran if the status field changes).

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-8144 September 14, 2017 15:07 Inactive
@@ -1,14 +1,6 @@
/* globals menu*/

Template.sideNav.helpers({
hasUnread() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not used helpers 🤷‍♂️

@geekgonecrazy
Copy link
Member

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

@sampaiodiego sampaiodiego temporarily deployed to rocket-chat-pr-8144 September 14, 2017 15:56 Inactive
@rodrigok rodrigok added this to the 0.59.0-rc.6 milestone Sep 14, 2017
@@ -55,6 +55,17 @@ Meteor.startup(function() {
KonchatNotification.newMessage(notification.payload.rid);
}
});

RocketChat.Notifications.onUser('subscriptions-changed', function(action, sub) {
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

covered by dc0aa06 =)

@sampaiodiego sampaiodiego temporarily deployed to rocket-chat-pr-8144 September 15, 2017 14:49 Inactive
@sampaiodiego
Copy link
Member Author

sampaiodiego commented Sep 15, 2017

@rodrigok this one ffb2480 covers the case when opening in a fresh window (the sound will play)

@rodrigok rodrigok merged commit 92f8b14 into develop Sep 16, 2017
@rodrigok rodrigok deleted the fix-new-room-sound branch September 16, 2017 22:46
rodrigok added a commit that referenced this pull request Sep 18, 2017
[FIX] Fix new room sound being played too much
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants