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

Some improvements from more-streams #4510

Merged
merged 1 commit into from
Oct 1, 2016
Merged

Some improvements from more-streams #4510

merged 1 commit into from
Oct 1, 2016

Conversation

rodrigok
Copy link
Member

@rodrigok rodrigok commented Oct 1, 2016

@RocketChat/core

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-4510 October 1, 2016 00:42 Inactive
@@ -160,7 +160,7 @@ Template.messagePopup.onCreated ->

template.records = new ReactiveVar []
Tracker.autorun ->
if template.data.collection.find?
if template.data.collection.findOne?
template.data.collection.find().count()
Copy link
Member

Choose a reason for hiding this comment

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

Should you use findOne here?

Copy link
Member

Choose a reason for hiding this comment

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

Also, it looks like it is not doing anything, but I may be wrong for not seeing the whole picture

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Ok, so in fact you're only checking if that's an array or a mongo collection?
It looked strange that you check for findOne but then use find, that's all. And what does it do template.data.collection.find().count()?

Copy link
Member Author

Choose a reason for hiding this comment

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

@marceloschmidt Yes, the count keep the code reactive to list changes

Copy link
Member

Choose a reason for hiding this comment

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

Cool!

@rodrigok rodrigok merged commit d31f865 into develop Oct 1, 2016
@rodrigok rodrigok deleted the develop-fixes branch October 1, 2016 13:38
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.

3 participants