summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/notes.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/notes.js')
-rw-r--r--app/assets/javascripts/notes.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js
index 55391ebc089..d2e602a0763 100644
--- a/app/assets/javascripts/notes.js
+++ b/app/assets/javascripts/notes.js
@@ -276,7 +276,7 @@ const normalizeNewlines = function(str) {
var votesBlock;
if (noteEntity.commands_changes) {
if ('merge' in noteEntity.commands_changes) {
- $.get(mrRefreshWidgetUrl);
+ Notes.checkMergeRequestStatus();
}
if ('emoji_award' in noteEntity.commands_changes) {
@@ -424,6 +424,7 @@ const normalizeNewlines = function(str) {
}
gl.utils.localTimeAgo($('.js-timeago'), false);
+ Notes.checkMergeRequestStatus();
return this.updateNotesCount(1);
};
@@ -769,7 +770,8 @@ const normalizeNewlines = function(str) {
}
};
})(this));
- // Decrement the "Discussions" counter only once
+
+ Notes.checkMergeRequestStatus();
return this.updateNotesCount(-1);
};
@@ -1115,6 +1117,12 @@ const normalizeNewlines = function(str) {
return $form;
};
+ Notes.checkMergeRequestStatus = function() {
+ if (gl.utils.getPagePath(1) === 'merge_requests') {
+ gl.mrWidget.checkStatus();
+ }
+ };
+
Notes.animateAppendNote = function(noteHtml, $notesList) {
const $note = $(noteHtml);