summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-11-08 13:50:27 +0000
committerSteve Azzopardi <sazzopardi@gitlab.com>2018-11-12 11:14:53 +0000
commit47909648963344a84939ca32bdfd8c9fc0a01810 (patch)
treec170640be59f144a96f98c20c9d8b1e12991b80e
parentca51e60f6fd55527b1afcb4c9f8019f215b3b77a (diff)
downloadgitlab-ce-47909648963344a84939ca32bdfd8c9fc0a01810.tar.gz
Merge branch 'notes-multiple-discussion-fetches' into 'master'
Stop multiple discussion requests See merge request gitlab-org/gitlab-ce!22908 (cherry picked from commit bd3a793fb781f36711baf6875e2f4e4a8de54ad8) 1519c347 Stop multiple discussion requests
-rw-r--r--app/assets/javascripts/notes/components/notes_app.vue6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/assets/javascripts/notes/components/notes_app.vue b/app/assets/javascripts/notes/components/notes_app.vue
index ed5ac112dc0..e555279a6ac 100644
--- a/app/assets/javascripts/notes/components/notes_app.vue
+++ b/app/assets/javascripts/notes/components/notes_app.vue
@@ -50,6 +50,7 @@ export default {
},
data() {
return {
+ isFetching: false,
currentFilter: null,
};
},
@@ -141,6 +142,10 @@ export default {
return discussion.individual_note ? { note: discussion.notes[0] } : { discussion };
},
fetchNotes() {
+ if (this.isFetching) return null;
+
+ this.isFetching = true;
+
return this.fetchDiscussions({ path: this.getNotesDataByProp('discussionsPath') })
.then(() => {
this.initPolling();
@@ -149,6 +154,7 @@ export default {
this.setLoadingState(false);
this.setNotesFetchedState(true);
eventHub.$emit('fetchedNotesData');
+ this.isFetching = false;
})
.then(() => this.$nextTick())
.then(() => this.checkLocationHash())