-
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
rocketchat-channel-settings-mail-messages coffee to js #6541
rocketchat-channel-settings-mail-messages coffee to js #6541
Conversation
00c0d64
to
b284dfe
Compare
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'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); |
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.
Why pass always true
? Some places passes false
@@ -0,0 +1,11 @@ | |||
export default function resetSelection() { | |||
const el = $('.messages-box')[0]; |
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 do you think? const [el] = $('.messages-box');
e18746b
to
d90b48d
Compare
d90b48d
to
d66c833
Compare
}, | ||
email() { | ||
const {emails} = Meteor.user(); | ||
return emails && emails[0].address; |
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.
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]; |
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.
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) { |
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.
user.email
can be empty
No description provided.