summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-11-08 13:50:27 +0000
committerFilipa Lacerda <filipa@gitlab.com>2018-11-08 13:50:27 +0000
commitbd3a793fb781f36711baf6875e2f4e4a8de54ad8 (patch)
treed765fae5d1fe47aeb553baaf6e2b31a6647a17db
parent2019d195a1528adfde6d962262a4781007a7cb66 (diff)
parent1519c3470ceb06329cbd1a53815d4c8adeb51bfb (diff)
downloadgitlab-ce-bd3a793fb781f36711baf6875e2f4e4a8de54ad8.tar.gz
Merge branch 'notes-multiple-discussion-fetches' into 'master'
Stop multiple discussion requests See merge request gitlab-org/gitlab-ce!22908
-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())