diff options
author | Alex Ford <alexrford@users.noreply.github.com> | 2017-07-07 18:29:32 +0100 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-07-07 13:29:32 -0400 |
commit | b03b9d736297a536bb1385c80f76f55473c9f637 (patch) | |
tree | 02624e221c072f1c6d70e01e29caf41645337b64 /webapp/components/sidebar.jsx | |
parent | e6ca2974cd504b26eee2549deb59b924daa4a104 (diff) | |
download | chat-b03b9d736297a536bb1385c80f76f55473c9f637.tar.gz chat-b03b9d736297a536bb1385c80f76f55473c9f637.tar.bz2 chat-b03b9d736297a536bb1385c80f76f55473c9f637.zip |
Minor fixes based on lgtm.com alerts (#6819)
* Remove a couple of superfluous trailing arguments
* Simplify assignment logic in a couple of places
* Modify some potentially inconsistent setState calls to use the function form
* Fix eslint errors
Diffstat (limited to 'webapp/components/sidebar.jsx')
-rw-r--r-- | webapp/components/sidebar.jsx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx index 16c96f1b6..798ce5691 100644 --- a/webapp/components/sidebar.jsx +++ b/webapp/components/sidebar.jsx @@ -309,14 +309,13 @@ export default class Sidebar extends React.Component { curIndex = i; } } - let nextChannel = allChannels[curIndex]; let nextIndex = curIndex; if (e.keyCode === Constants.KeyCodes.DOWN) { nextIndex = curIndex + 1; } else if (e.keyCode === Constants.KeyCodes.UP) { nextIndex = curIndex - 1; } - nextChannel = allChannels[Utils.mod(nextIndex, allChannels.length)]; + const nextChannel = allChannels[Utils.mod(nextIndex, allChannels.length)]; ChannelActions.goToChannel(nextChannel); this.updateScrollbarOnChannelChange(nextChannel); this.isSwitchingChannel = false; @@ -342,7 +341,6 @@ export default class Sidebar extends React.Component { curIndex = i; } } - let nextChannel = allChannels[curIndex]; let nextIndex = curIndex; let count = 0; let increment = 0; @@ -359,7 +357,7 @@ export default class Sidebar extends React.Component { unreadCounts = ChannelStore.getUnreadCount(allChannels[nextIndex].id); } if (unreadCounts.msgs !== 0 || unreadCounts.mentions !== 0) { - nextChannel = allChannels[nextIndex]; + const nextChannel = allChannels[nextIndex]; ChannelActions.goToChannel(nextChannel); this.updateScrollbarOnChannelChange(nextChannel); } |