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

converted messageAttachment coffee to js #6500

Merged

Conversation

ggazzo
Copy link
Member

@ggazzo ggazzo commented Mar 27, 2017

@RocketChat/core

}
if (Meteor.isCordova && (url && url[0] === '/')) {
url = Meteor.absoluteUrl().replace(/\/$/, '') + url;
query = `rc_uid=${ Meteor.userId() }&rc_token=${ Meteor._localStorage.getItem('Meteor.loginToken') }`;
Copy link
Member

Choose a reason for hiding this comment

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

Why not declare the variable query here as const?

return true;
},
getImageHeight(height) {
return height || 200;
Copy link
Member

Choose a reason for hiding this comment

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

You can use the param's default value here:

getImageHeight(height = 200) {
  return height;
}

return '#D30230';
default:
return this.color;
}
Copy link
Member

Choose a reason for hiding this comment

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

A improvement for that IMO is:

const colors = {
  good: '#35AC19',
  warning: '#FCB316',
  danger: '#D30230'
};
return colors[this.color] || this.color

@geekgonecrazy geekgonecrazy changed the title converted messageAttachent coffee to js converted messageAttachment coffee to js Mar 28, 2017
@ggazzo ggazzo force-pushed the rocketchat-message-attachments branch from afa023b to 4e1d31e Compare March 28, 2017 19:06
@engelgabriel engelgabriel merged commit d408fa7 into RocketChat:develop Mar 29, 2017
@engelgabriel engelgabriel added this to the 0.55.0 milestone Mar 29, 2017
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.

4 participants