Convert Ui-Master Package to Js#6498
Conversation
| @@ -0,0 +1,303 @@ | |||
| /* globals toolbarSearch, menu, isRtl, fireGlobalEvent, CachedChatSubscription */ | |||
| Template.body.onRendered(function() { | |||
| $(document.body).on('keydown', function(e) { | |||
There was a problem hiding this comment.
@rodrigok It was never used again, breaking a eslint rule
There was a problem hiding this comment.
Ok, so remove the variable assign, but keep the Clipboard instantiation
| ls: 1 | ||
| } | ||
| }); | ||
| fetch = subscriptions.fetch(); |
There was a problem hiding this comment.
Where did you declare this var?
| } | ||
| }); | ||
| fetch = subscriptions.fetch(); | ||
| const results = []; |
There was a problem hiding this comment.
There is no need to get and return results here
| fetch = subscriptions.fetch(); | ||
| const results = []; | ||
|
|
||
| Object.keys(fetch).forEach((key) =>{ |
There was a problem hiding this comment.
The fetch's result is not an object, it's an array
| }, | ||
| requirePasswordChange() { | ||
| const user = Meteor.user(); | ||
| return (user ? user.requirePasswordChange : null) === true; |
There was a problem hiding this comment.
You can simplify:
return user && user.requirePasswordChange === true;
| return; | ||
| } | ||
| t.touchstartX = null; | ||
| t.touchstartY = null; |
There was a problem hiding this comment.
Why did you change from undefined to null?
| }, | ||
| 'touchmove'(e, t) { | ||
| if (t.touchstartX != null) { | ||
| const touch = e.originalEvent.touches[0]; |
There was a problem hiding this comment.
You can use const [touch] = e.originalEvent.touches; here
| cancelButtonText: t('Cancel') | ||
| }); | ||
| const user = Meteor.user(); | ||
| const settings = user.settings; |
| }); | ||
| const user = Meteor.user(); | ||
| const settings = user.settings; | ||
| const prefs = user ? settings ? settings.preferences : null : null; |
There was a problem hiding this comment.
Simplify with const prefs = settings && settings.preferences
| const user = Meteor.user(); | ||
| const settings = user.settings; | ||
| const prefs = user ? settings ? settings.preferences : null : null; | ||
| if (prefs != null ? prefs.hideUsernames : null) { |
There was a problem hiding this comment.
Simplify with if (prefs && prefs.hideUsernames) {
@RocketChat/core