Commit 058f186c authored by Lukas Eipert's avatar Lukas Eipert

Fix some eslint-disables

This fixes some eslint-disables in
app/assets/javascripts/diff_notes/components/jump_to_discussion.js.
parent 78f60954
/* eslint-disable func-names, guard-for-in, no-restricted-syntax, no-lonely-if, no-continue */ /* eslint-disable func-names, no-continue */
/* global CommentsStore */ /* global CommentsStore */
import $ from 'jquery'; import $ from 'jquery';
...@@ -42,13 +42,13 @@ const JumpToDiscussion = Vue.extend({ ...@@ -42,13 +42,13 @@ const JumpToDiscussion = Vue.extend({
}, },
lastResolvedId() { lastResolvedId() {
let lastId; let lastId;
for (const discussionId in this.discussions) { Object.keys(this.discussions).forEach(discussionId => {
const discussion = this.discussions[discussionId]; const discussion = this.discussions[discussionId];
if (!discussion.isResolved()) { if (!discussion.isResolved()) {
lastId = discussion.id; lastId = discussion.id;
} }
} });
return lastId; return lastId;
}, },
}, },
...@@ -95,13 +95,11 @@ const JumpToDiscussion = Vue.extend({ ...@@ -95,13 +95,11 @@ const JumpToDiscussion = Vue.extend({
if (unresolvedDiscussionCount === 1) { if (unresolvedDiscussionCount === 1) {
hasDiscussionsToJumpTo = false; hasDiscussionsToJumpTo = false;
} }
} else { } else if (unresolvedDiscussionCount === 0) {
// If there are no unresolved discussions on the diffs tab at all, // If there are no unresolved discussions on the diffs tab at all,
// there are no discussions to jump to. // there are no discussions to jump to.
if (unresolvedDiscussionCount === 0) {
hasDiscussionsToJumpTo = false; hasDiscussionsToJumpTo = false;
} }
}
} else if (activeTab !== 'show') { } else if (activeTab !== 'show') {
// If we are on the commits or builds tabs, // If we are on the commits or builds tabs,
// there are no discussions to jump to. // there are no discussions to jump to.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment