summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryce Johnson <bryce@gitlab.com>2016-10-25 13:38:57 +0200
committerBryce Johnson <bryce@gitlab.com>2016-10-25 13:38:57 +0200
commita2ee7ccc0c5565cf4bab4124030911d2e8aef769 (patch)
treecb6cdf4e68e6b351485280e5cafabdad53b859e1
parent2762acfcdc32b764e435759cd95c034d8375e242 (diff)
downloadgitlab-ce-a2ee7ccc0c5565cf4bab4124030911d2e8aef769.tar.gz
Only get resource if not already getting and there are subscribers.
-rw-r--r--app/assets/javascripts/subbable_resource.js.es63
1 files changed, 2 insertions, 1 deletions
diff --git a/app/assets/javascripts/subbable_resource.js.es6 b/app/assets/javascripts/subbable_resource.js.es6
index e5f9d70f0d2..fe61054c420 100644
--- a/app/assets/javascripts/subbable_resource.js.es6
+++ b/app/assets/javascripts/subbable_resource.js.es6
@@ -99,7 +99,8 @@
}
getResource() {
- if (this.state.loading && this.subscribers.length) {
+ const totalSubscribers = Object.keys(this.subscribers).length;
+ if (!this.state.loading || !totalSubscribers) {
return;
}
this.state.loading = true;