diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-11-08 13:50:27 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-11-08 13:50:27 +0000 |
commit | bd3a793fb781f36711baf6875e2f4e4a8de54ad8 (patch) | |
tree | d765fae5d1fe47aeb553baaf6e2b31a6647a17db | |
parent | 2019d195a1528adfde6d962262a4781007a7cb66 (diff) | |
parent | 1519c3470ceb06329cbd1a53815d4c8adeb51bfb (diff) | |
download | gitlab-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.vue | 6 |
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()) |