summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2016-03-02 17:37:38 -0500
committerAlfredo Sumaran <alfredo@gitlab.com>2016-03-03 15:20:01 -0500
commit5bd22b28fa4f743014bb7564a601c7fa8409d805 (patch)
tree3bfc5c0941ee0c9404a2ea8ba684372da7eff7c6
parent3fbdca214c355d9b7bab9cdf00ad3546d96c267e (diff)
downloadgitlab-ce-5bd22b28fa4f743014bb7564a601c7fa8409d805.tar.gz
Prevent multiple refreshes if a refresh is happening
-rw-r--r--app/assets/javascripts/notes.js.coffee4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee
index b3073d082de..88c9046a85c 100644
--- a/app/assets/javascripts/notes.js.coffee
+++ b/app/assets/javascripts/notes.js.coffee
@@ -96,6 +96,8 @@ class @Notes
, @polling_interval
refresh: ->
+ return if @refreshing is true
+ refreshing = true
if not document.hidden and document.URL.indexOf(@noteable_url) is 0
@getContent()
@@ -113,6 +115,8 @@ class @Notes
@renderDiscussionNote(note)
else
@renderNote(note)
+ always: =>
+ @refreshing = false
###
Increase @polling_interval up to 120 seconds on every function call,