summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/diff_notes/diff_notes_bundle.js
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-08-08 14:25:00 +0100
committerPhil Hughes <me@iamphill.com>2017-08-15 16:09:36 +0100
commit554afea059446384783f3c68c09ac56afa0e7d49 (patch)
tree950495ef2a046ccf514dfeab8cacb38b7e817497 /app/assets/javascripts/diff_notes/diff_notes_bundle.js
parent0ec87b3bf0ac27af5f5fedf97d51c8b14b050f50 (diff)
downloadgitlab-ce-554afea059446384783f3c68c09ac56afa0e7d49.tar.gz
Fix race condition with dispatcher.jsdispatcher-race-condition-fix
The dispatcher was trying to create a new instance of a class that is loaded in a file after main.js which would cause the filtered search to not work on issues. This would only happen on the first load when the JS is not cached. If the JS is cached, then everything will be fine.
Diffstat (limited to 'app/assets/javascripts/diff_notes/diff_notes_bundle.js')
-rw-r--r--app/assets/javascripts/diff_notes/diff_notes_bundle.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/assets/javascripts/diff_notes/diff_notes_bundle.js b/app/assets/javascripts/diff_notes/diff_notes_bundle.js
index a2d33b0936e..5decfc1dc01 100644
--- a/app/assets/javascripts/diff_notes/diff_notes_bundle.js
+++ b/app/assets/javascripts/diff_notes/diff_notes_bundle.js
@@ -42,6 +42,10 @@ $(() => {
$components.each(function () {
const $this = $(this);
const noteId = $this.attr(':note-id');
+ const discussionId = $this.attr(':discussion-id');
+
+ if ($this.is('comment-and-resolve-btn') && !discussionId) return;
+
const tmp = Vue.extend({
template: $this.get(0).outerHTML
});