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

rocketchat-channel-settings-mail-messages coffee to js #6541

Conversation

ggazzo
Copy link
Member

@ggazzo ggazzo commented Mar 30, 2017

No description provided.

@ggazzo ggazzo changed the title rocketchat-channel-settings-mail-messages coffe to js rocketchat-channel-settings-mail-messages coffee to js Mar 30, 2017
@ggazzo ggazzo force-pushed the rocketchat-channel-settings-mail-messages branch 2 times, most recently from 00c0d64 to b284dfe Compare March 31, 2017 20:04
Copy link
Member

@rodrigok rodrigok left a comment

Choose a reason for hiding this comment

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

I'll continue the review after changes

const view = Blaze.getView(el);
if (view && typeof view.templateInstance === 'function') {
const {resetSelection} = view.templateInstance();
typeof resetSelection === 'function' && resetSelection(true);
Copy link
Member

Choose a reason for hiding this comment

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

Why pass always true? Some places passes false

@@ -0,0 +1,11 @@
export default function resetSelection() {
const el = $('.messages-box')[0];
Copy link
Member

Choose a reason for hiding this comment

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

What do you think? const [el] = $('.messages-box');

@ggazzo ggazzo force-pushed the rocketchat-channel-settings-mail-messages branch 2 times, most recently from e18746b to d90b48d Compare March 31, 2017 21:07
@ggazzo ggazzo force-pushed the rocketchat-channel-settings-mail-messages branch from d90b48d to d66c833 Compare March 31, 2017 21:13
},
email() {
const {emails} = Meteor.user();
return emails && emails[0].address;
Copy link
Member

Choose a reason for hiding this comment

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

emails can exists but be empty

const emails = t.$('input[name=to_emails]').val().trim().split(',');
const erroredEmails = [];
for (let j = 0, len = emails.length; j < len; j++) {
const email = emails[j];
Copy link
Member

Choose a reason for hiding this comment

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

for (const email of emails) {

if (data.to_users.length > 0) {
_.each(data.to_users, (username) => {
const user = RocketChat.models.Users.findOneByUsername(username);
if (user && user.emails && user.emails[0].address) {
Copy link
Member

Choose a reason for hiding this comment

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

user.email can be empty

@rodrigok rodrigok added this to the 0.55.0 milestone Apr 3, 2017
@engelgabriel engelgabriel merged commit 92f67aa into RocketChat:develop Apr 3, 2017
@ggazzo ggazzo deleted the rocketchat-channel-settings-mail-messages branch April 3, 2017 19:37
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